More typechecking. Added 3 error classes. Some refactoring in visitors and util-class. Typechecking causes many old tests to fail. They will have to be rewritten properly. There is still much work left to do on typecheckvisitor