Fixed bug in directory creation (if non-existent)

Also, the $filesystem->mkdir() and $file->move() could be wrapped in try/catch blocks and a "failed" response returned.