Return remaining unparsed data from parse functions

This depends on ashfall's PR #4, so it currently contains her code from there. The diff will make more sense when that's already merged.
Curious. What's the behaviour when this code is faced with a malicious client/server that lies about length values?