Rewrote item serializer to be simpler and faster.

There were some error conditions that were pretty well impossible and
not covered.  Simplifying it made those errors go away, increased
coverage and should speed it up quite a bit.