Add basic support for hierarchies, fixes #14