Updating a lot of typechecking code to remove redundant code so that it's easier to fix in the future
Splitting up type checker and adding more test cases