Refactor python/tidy.py

- Removed a global that was used to store state.
- Gathered license checking logic into one file.
- Removed some redundant exceptions.
- Files with errors are now shown as relative paths.