Add initial support for HTTP upgrade

This adds support for HTTP upgrade, using a handshake similar to the web socket protocol but with a different magic number and using different header names for the challenge and response.