Switch from Unipath to pathlib.

Also clean up some pep8.