fixes issue #498

Replaces run_tests.sh with run_tests.py for long term maintablility.