Started moving code out of mongoloader.js and into middleware.js, got homepage working in a basic manner