add support for global directives

Fixes #21