Added Handlebars template engine.

Code refactoring and clean up with the use of handlebars template
engine.