refactoring some intermediate graph language code out of ABC2HS