add support for enums and unions

these were mentioned in documentation but not realized in code
Merge pull request #4 from hwhw/master

add support for enums and unions