Prepare for python 3.3.

- Run 2to3 and make the changes
- Remove `contextlib.nested` usage
- Use `super()`
- Fix `flake8` errors