Moved Upgrader code to server implementation.
Renamed constants to match Go style guidelines.
Updated Origin check.
The host in the Origin header must match the host of the request by default.
Moved Upgrader variable to package level.
Removed unnecessary call to "http.Error".
Simplified returning of errors.
Make subprotocol negotiation more flexible.
Updated docs.