Refactored frame processing

Refactored frame processing to implement a lot more of RFC6455. Now
supports:
- frames > 2KB
- fragmented frames
- control frames between fragments