Implemented RequireJS and moved template to external file.