Move the code that loads the config so that it gets loaded earlier.

This moves the config loading so that it takes place earlier. It makes the config values available in hooks that previously took place before the config was loaded.

The hooks that will now have access to config values are:
- request_url
- before_load_content
- before_404_load_content
- after_404_load_content
- after_load_content