Python 2 compatibility fixes, script fix

- Added exit status to test script
- Added print_function to some files