#7 1. Code cleanup by removing dependency on directly accessing standard DOM function.
2. Use template html files for everything possible.
3. Other refactoring for things inside the controller.