Rewrote typechecker using Python 3 annotations

The typechecking utility now uses Python 3 annotations, rather than an
explicit list of argument types passed to the decorator, to typecheck
functions and methods