Move db.js to config folder
Refactor db.js
Use minified template files in production