Started modularizing the server code.
This is a first pass at splitting server.ts into modules.  Added a few unit tests as well