Adds support for additional permalink structures

fixes #2057

- uses express’ Route object to create RegExp’s
 that we use to check the incoming path
- refactored structure of fronted controller single
 tests to be easier to read
- amend regex to incorporate new allowed permalink
 structure
Merge pull request #2116 from hswolff/permalink-upgrade

Adds support for additional permalink structures
Ensure filters get default priority if priority is null

- null priority should be set to the default
- second part to https://github.com/TryGhost/Ghost-App/commit/86619cb087774a3e7cae39b13527191e62fdf5a4
Cleanup dependency order in package.json

- because OCD
Add logging config option

closes #2103
- Deactivate logging for testing environments
- Override logging with settings from config
Update to `npm install` command

fixes #1053

- npm install doesn't need a path to grunt, and fails on Windows if it has one
- submodule update is handled by grunt (albeit badly... but let's fix that!)
Merge pull request #2176 from ErisDS/issue-1053

Update to `npm install` command
Helper updates for Tag Pages

fixes #2112
refs #1833

- modified config.urlFor to handle tag pages

- modified {{#tags}} handlebars helper to autolink to
  tag pages. Additional autolink="false" parameter can
  be used to deactivate autolinking

- modified url handlebars helper to handle tags

- added isTag function to schema

- added unit test for additional urlFor functionality

- added unit test for {{#tags}} helper modifications

- added unit test for url handlebards helper
Update express-hbs to fix block helper issue.

fixes #2127
- Update express-hbs to 0.7.9
Added package.js support for themes (and plugins)

Closes #2081
* Amended require-tree to populate availableThemes and availablePlugins to use full file names (`basename.ext`) as keys instead of just basename. This way `image.jpg`, `image.png`, `image.gif` won't overwrite the `image` key.
* Amended require-tree to allow package.json file parsing to return the contents of the file as json on the `package.json` key.
* settings api populates theme data `package` if it exists. Otherwise it assigns `false` to it
* `general.hbs` (salute) was reworked to if there is the package key on the theme is not false, it will use the `name` and `version` keys of that. You can break it by not having a `name` or `version` in the package.json file.
* Added error and warning messages for package.json file parse errors and misses
Merge pull request #2155 from halfdan/2127-express-fix

Update express-hbs to fix block helper issue.
Make session expiry less arsey

closes #2171
- added authentication middleware
- removed authentication from routes
- moved authentication before CSRF validation
- moved caching rules before authentication
- changed/added test
A first step towards theme debugging

issue #2204
- allow handlebars log helper to output to console in dev mode
Merge pull request #2156 from javorszky/iss2081

Added package.js support for themes (and plugins)
Merge pull request #2173 from halfdan/2103-connect-logging

Add logging config option
Remove unneeded extend implementation.

refs #2179, #2156
- Replace extend with _.extend
Fix incorrect test name
Merge pull request #2210 from halfdan/use-lodash-extend

Remove unneeded extend implementation.
Fix input:focus border issues from #2088
Merge pull request #2215 from PaulAdamDavis/master

Fix input:focus border issues from #2088