Refactor of multipart support (interim commit, breaks callback support)

The initial implementation of multipart message processing was a nice
first try but there were some bugs and the code had some conceptual
problems that made fixing them tricky. This implementation benefits from
the first pass and is much cleaner.

Restored callback support will be forthcoming.
Completed rewrite of multipart support