We get little benefit from our mypy QA checks at the moment, because we skip
imports. This patch is what's needed to make mypy succeed with imports on a
single file: master.py
It also updates mypy to the current version, and enables a QA check.
Mypy bugs I encountered:
dict.update with kwargs not supported:
https://github.com/python/mypy/issues/1031
property setters and getters must be adjacent:
https://github.com/python/mypy/issues/1465
The primary motivation here (and for all the other moving around) is to present
a clean "front of house" to library users, and to migrate primary objects to
the top of the module hierarchy.