Added boolean for if we want to log debug files to the file system or not

- If FALSE: all error messages will be printed in the console.
- If TRUE: all error messages will be logged in the /debug/ folder in
the project root.
Added functions to safely manipulate files and folders

Includes:
- Making directories
- Writing to files
- Opening files
- Copying files
- Closing files
Updated file emitter to operate safely if there are no write permissions on the server it is situated on.

- Have also added debug mode for the file emitter
Updated debug setup stage and error messaging