Completly redone frame parsing since previous implementation failed under certain scenarios.

The new implementation doesn't replicate state, instead leaves everything to the socket buffer
and only removes from it once a whole frame can be read.
Abort socket (and possibly reconnect) on wrong end-frame or invalid method according to spec.