Requirejs

This PR aims at:
1. adding requirejs;
2. creating the js and template modules.