Made version.py work with Python versions 2.5 to 3.x

It had been using 'subprocess.check_output' which was introduced in
version 2.7, and 'print' without brackets which upsets Python 3.