Templating and routing

Modularized the loader, and added templating and routing
Fixes

More