Switched to using requirejs

Used for both modules and template loading