Dashboard2 - template node - debugging

Need advice, what is the best way to write and debug HTML/JS code in “template node”.
Firefox DevTools only partially helps, the generated debug links don't point to the code.
Can version control be used?