TryGhost/Ghost — pull request #1535 by hswolff (2013-11-22 04:01:46+00:00)
Title: WIP: Create config module to standardise getting paths and abs URLs

This PR is for issue #1390. Currently a WIP, with one tasks remaining: fix broken tests. Rest of code is complete.

I followed the lead of rails (refer to the example app's https://github.com/RailsApps/learn-rails) and created a `config` directory where all configurations should reside.

This involved:

* Moving `./core/config-loader.js` to `./core/server/config/loader.js` pretty much in its entirety. I removed the `loadConfig` function and made it directly exported from the file as that is all that the file does.

* Creating the `./core/server/config/paths.js`. Most of this file's contents comes from ghost.js' `ghost.paths()` and `ghost.getPaths()`. Those were moved into this new file and modified to not depend on the ghost singleton.

This change to the config directory has had the lovely side effect of reducing the dependency on the ghost singleton object.

I have yet to go through the code base and update all string references to paths, however I did go through and update all `ghost.paths()` references. That task can be a nice easy follow-up once this PR is merged.

Please note: this PR was built on top of PR #1444 and PR #1521. Those PR's should be merged first, in that order, before this PR is considered. It will also reduce the # of commits.