Add a mypy precommit hook
This requires some more stub-missing entries declared in mypy.ini to pass OK.