Add real error logging to fatal errors.
Move controller matching to after preRequest to make it possible for code to change the URL.