Add tox support

Rationale: make it easy to run test suites against python 3, and also run linting easily:

```bash
# Run standard tests
$ tox -e py27

# Run test for Python 3
$ tox -e py33

# Lint whole suite using pep8 and pyflakes
$ tox -e flake8

# Run it all
$ tox
```

This patch also fixes a deprecation issue in setup.py: file -> open