Rewrite config handling to use local configuration files instead

This changes the configuration of the application to use separate files, instead of having their settings stored directly in `index.php`.

I'll submit a separate pull request for configuration / installation updates.