Added a shitload of extra tests for semantic checks.
Basic working typechecker & tests.