Add type hints to various parts of the code base.