Add support for RFC 6455 WebSockets

This patch is based on gunicorn example WebSocket server, mainly on
changes introduced in commit 90e698aa3c3708d163e175249c5a6e299c15687b
by CMGS (https://github.com/CMGS).