Work on MO serdes:
* Add support for serializing enum constants.
* Add some tests for and fix some bugs related to references
serialization and deserialization.

Change-Id: I79c4e914f5ea3740295e0016d8e051a261a211d0
Signed-off-by: Rob Adams <readams@readams.net>