added support for creating enums from objects and giving textual value different than the name.