Using the cache for 3 spaces.
Passing certain settings from config.php to the javascript file through config.js.php
Code improvements and logger introduced.

  Removed the closing php tags to avoid messages such as
  "headers already sent".
  The error reporting can now be enabled in config.php.
  Using one instance of the logger to create a stacktrace.
  Minor cleanup.
Using a relative path to the error document. URL update in the public directory.

  By adding a space to the directory or updating its cache it will be checked
  if the public directory should contain the cache or the direct space URL
  depending on what the space has defined in their status json.