Catch permissions issues

Permissions errors when trying to write to cache or css directory now writes an error to the header or error log.

Error log now uses .log format for auto updating errors, now you don't have to close and reopen the .txt file to see new errors.