Initial serialization work

Pretty much a copy of the work done in Buxton's internal
serialization code