Update templates.js

Removed un-needed conditional when building the namespace.
Fix exposed templates so they can have non-identifier names
Load route modules automatically like middleware modules