Add support for enums.

Fixes #1.
Merge branch 'enum-support'