Fix live theme switching not working on subdirectories

Closes #1770
- Previously, the middleware would check that the route on the stack was an empty string, which worked when there was no subdirectories
- When subdirectories were added, the proper route was only set when
  updating the theme
- Because it was only set when updating, this explains themes working on
  initial load, since the stack location was looking for an empty
  string, which is what the middleware was initialized with
- However, once a new theme was set, it was still look for an empty
  string, which would never exist, which caused the issue
- Now, the route is properly set on initialization of the middleware,
  and then the `config.paths().subdir` property is used for the check
Update import tool to be safe

closes #1681

- import doesn't override user credentials
- import doesn't override theme
- import doesn't kill session
- import does refresh the settings cache
- updated tests, they now use a fixture instead of a generated export
- tests check to ensure import is safe
Add welcome email for new sign ups

Closes #1766
- Once signed up, a quick welcome email is sent
- Links to their blog url, and gives the email they used to sign up
RSS uses correct links when dated permalinks are enabled

closes #1777
- Uses coreHelpers.url to resolve post url instead of assuming it is siteUrl + post.slug
- Functional feed tests now check for content instead of just rss tags
Fixing notifications on ugly debug page

- also fixes an issue where the debug tools didn't redirect properly when Ghost was operating in a subdirectory.
Ensure that RSS doesn't 404 when there is no user

fixes #1776

- could really do with adding a test for this
Don't allow a subdirectory called Ghost

fixes #1755

- adds extra validation to config loader
- adds tests for config loader and validation
Fix routing of posts and static pages

closes #1757 and #1773

- switches routes.frontend for posts and pages
to use a regex with two capturing groups.  This removes
the need to dynamically remove an express route at a
later point, leaving the decision making to frontend
controller.

- added unit tests for all routing conditions that 
can arise for posts and pages.

- updated functional tests to also test for same thing
in unit tests

- removes old code from server/api/index that used
to fix this issue, but is no longer needed

- removed some un-needed require statements in routes/admin
Update connect-slashes to version 1.2.0
Update grunt-update-submodules to 0.2.1

issue #1787

- hopefully resolves problems with some versions of npm
Switched Socket permissions to 660.
This adds write permissions for groups and is
more security conscious globally.
Enforce 2-digit dates in permalinks

fixes #1800

- changed permalink regex to require 4/2/2/slug
- changed url helper to enforce the same
- changed permalink toggle to set a specific state, this means the
  functional tests are independent again
- chnaged permalink toggle to wait for the settings page to load
- change as many frontend tests to not login as possible
Update Casper version on Travis
Functional test debugging & improvements

issue #1702
Date permalinks use published date

fixes #1803

- switches date permalinks from created_at to published_at
- enforces that the post will ONLY render if the date is valid and correct
Route tests

issue #1773

- Adds functional tests for frontend routing
- Tests the request-response contract
- Requires db access at the moment
- Tests #1790
Fix gravatar retrieval

fixes #1778

- use http for initial request, store url with no schema
Update CONTRIBUTING.md
Cache control headers & query string asset management

closes #1470
issue #1405

- added cache control middleware
- added defaults for all routes, assets, etc
- updated asset helper to add a query string with a timestamp hash to all assets
- added unit tests for asset and ghostScriptTags helpers
- added cache-control checks to route tests
Move config path.update to config.load

issue #1789

- we can do this step a bit earlier and it aids with neatness
- also means for tests that config.load() is enough to get config & paths initialised