Add tests and make compatible with other Python versions.

 - add some basic unit tests
 - add progress_stream parameter to the core command
 - make compatible with Python 2.6+ and Python 3.2+