Convert run_tests.sh to a Python script (#498)

Replaces run_tests.sh with run_tests.py for long term maintablility.
It's enough to use `and not os.environ.get('CI')`. It checks for `None` implicitly.