clean up randomly and move a lot of directive templates into own files.