Feature #2746: Refactor template-tab code

Separate html from methods (button click events, etc)
Bug #2777: Clear IMAGE_ID field in wizard on disk selection