Some cleanup, and also added support for a value mapping which can be used to make enum transformation work magically