more modern syntax
fix #706 local classes don't have metamodels
clean up member resolution and make it more robust