The mask is now properly applied as an XOR to the frame's payload. Payload size of larger packets should now be calculated correctly. Removed old WebSocket code. Removed temporary debug messages.