Functions added in the API to fit the design doc.

Functions de/serialize<TYPE>Begin and de/serialize<TYPE>End have been
added. They were in the design document but not in the code.