Extend the typer to typecheck many more things

Modulo comments, LGTM