Allow use with normal http server

This modifies the handler to allow it to be used outside of an express/connect application (for example using the normal Node http server or a standalone router). It also adds tests to verify this behavior.

The code for sending the result is a little more verbose, since it cannot use any of the express helpers.