Made all the TypeEncoders safely serializable.  Standardized EntityRelationshipTypeEncoder and added tests for it.