Internal refactorings.

Internal refactorings to make the acts_as_enumerated and has_enumerated
macros somewhat manageable.