Support for generating enums. Fixes #1.