Add broken tests to test typechecker
Refactor similar types
Add a dispatching typecheck function and refactor old one to typecheck body statements