Use pathlib for handling file manipulations

*repeat, due to branch borkage*

Just playing around with pathlib for now.

Makes some things much nicer like default open encoding, makes some things more annoying... see diff.