Move the HTML for the dialogs to separate template files, using the template mechanism from core. It is still possible to specify the HTML directly as before, to be used in gadgets etc. Change-Id: Ia7ad5aaa9cac429d1c9d706bdf6760e3eda358bc