Working type checker; needs some work on the error messages and identifier types are not checked (yet)