Cleanup tests.

- Reorganize imports
- Use tuple instead of list
- Use open() as a context manager
Do not install argparse and unittest2 on Python 2.7.

Also, the `--use-mirrors` option is deprecated now. See PEP 449.