changed Groovy code style towards Java, removed unnecessary imports in templates, relations DSL handling implemented