Implemented HTTP redirect and authentication in client handshake
Applied pyflakes & pep8
Added support for Origin checking (both client- and server-side)