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

A general cleanup to utilise Pythons import abilities. This compacts the code in various places and makes it slightly more readable and lines shorter, where possible.

Also a few cases of replacing multiple write() calls with a single call that uses the multiline variable. Makes larger blocks more readable and was already being used for SSH configuration.