refactor server.js and add config functions so we fail if not configured
fix unit tests
Merge pull request #522 from jlipps/master

Add a configuration scheme so we fail gracefully on config errors