Python3 annotations

As the commits will testify, this is not my work, I'm only the janitor here :-)

I've brought in @jlowin's Python 3 annotations work, merged some conflicts, and re-added some code that got dropped during the merge.
Maybe this could be simplified by bringing the branch at the top level like the following:

```Python
if sys.version_info[0] >= 3:
    def getargspec(func):
        return insepect.getargspec(func)
else:
    def getargspec(func):
        return inspect.getfullargspec(func)
```