Adding support for registering enumerated types in a more straightforward way (original pr #505)