Hardened filename handling
- Added ensure_existance function which will raise an exception or create a directory
- Reworked filename generation to incldue references to this function
- In the process, streamlined the generation to call os.path.join less