Improve type annotations throughout the module
All main module's files were updated with exhaustive type annotations,
making the necessary (minor) fixes for the code to be compliant with it.
Also, __future__. annotations was imported to avoid using strings when
possible.