move proxy code to a module file

This allows us to include it from within another express app in case we
don't want to have a standalone proxy.

Just moves out the app.get and wraps it in module.exports and then
included that in the index file and uses the export to instantiate the
server.