Grammar support for role hierarchies, and parser tests

Fixes #3