Re-write to be simpler for hosting.

This removes dependencies, but also the ability to run SSL. But node.js
requires more configuration for SSL anyways. For SSL, run it behind a
reverse proxy like nginx.

Also moves helper functions into lib/ and re-prioritizes http errors.