Hook up typechecker.

This does nothing with the extra information except warn if there's an error
returned by the typechecker (e.g. var not used).

This is the first step towards addressing #7.