Clean up imports and various other smaller items

- Import OzException directly instead of referencing the full package name
- Import various os.path and oz.ozutil functions to more readable and shorter lines
- Replace multiple write() calls with a single multi line write() call