Add command line argument support and support Python 2.6

- Support Python 2.6, 2.7, 3.2 and 3.3.
- Add command line argument support for passing in the output
  filename. Handle stdout by using -.