Implement remaining semantics checks and add many more tests

Should be `import Namer._` in class Namer. I'm afraid I introduced that one...