Revert "Sanitize filenames, implemented pathinfo,"

This reverts commit da7ab27986b1f7d1b7e3890d55b53e1724743287.
Revert "Revert "Sanitize filenames, implemented pathinfo,""

This reverts commit 69ab58205f176a253feb5fef8bb8bea47b241220.