implement all the frames

Implement all the frames.
Fix all the endiannesses.
Add a rudimentary callback API.
Create a dodgy little test client thing.