Improve error handling and move error handler, autoloader, and registry initialization outside of bootstrap.php.