adds sync end points
abstractions to allow for testing

- adds main.js to start the app
- changes app.js to be a factory so that we can mock dependencies and easily start the app with supertest