First pass at serializing to HDF5.
Minor bug fixes and updates.