common: Add macro generating serializable enum classes

Add macro that creates serializable enum classes with values validated
during deserialization.

Change-Id: I71be986862fa9be372521ab8673dd528fe10a98b