errorhandler & event: Implemented 403, 404 and 405 event handling with errors. Also introduced a new config variable called 'environment'.