Lots of format changes (tabs throughout for easier editing) and use of os.path.join throughout to ensure cross-platform consistency