Cleanup. Moved config.php to global.php. Added some checks for defaults, writable dirs, etc.