Initial implementation of serialize method.

Still missing key fields and error checking, but basic skeleton is working.
Added support for parsing the checksum algorithm.

Also added initial support for serialization of SystemMetadata.