Add type annotations for various BaseResolver attributes
This adds class level type annotations for BaseResolver attributes.
partially based on the existing annotations from `.reset()` (which have
now moved).
Mypy does not infer BaseResolver attributes because those are not
defined `.__init__()` method, but in `.reset()`; there is already a
pylint override for this. The result is that application code that
accesses `resolver.port` and other attributes incorrectly triggers mypy
errors about the seemingly not existing attribute.
While at it, fix a few easy to address mypy/flake8 warnings that popped
up on my screen while editing this file.