Moved initialisation of routes and models

Moved the file out of sever.js and turned into a module.