Feature/standalone server

lib/server.js probably wants a bit of a refactor, but that can be done either now or post-merge.