add support for enums and unions

these were mentioned in documentation but not realized in code