Update editor markdown tests

closes #1299

- update tests to check for full strings with spaces now that this is no
  longer an issue
- reorganise duplicated test for images
Redirect uppercase routes to lowercase version

fixes #3857

- adds uncapitalise middleware which detects uppercase in req.path and
  redirects to the lowercase equivalent
- change the ghost route to a regex, just so it's consistent with other
  routes in the file
Delete tokens before deleting a user

fixes #3750

- Updated tests to create tokens for one user. This caused the tests to
  fail for MySQL exposing the bug.
- Delete user's tokens along with posts
Show warning dialog if session has ended in editor

Closes #3839
- Display a warning modal in the editor routes if the user
  is logged out due to re-authorization problems.  This provides
  a chance to copy any unsaved content before being sent to the
  signin page to log back in.
Merge pull request #3873 from jaswilli/issue-3839

Show warning dialog if session has ended in editor
Fix up user profile
Merge pull request #3865 from ErisDS/issue-3750

Delete tokens before deleting a user
Merge pull request #3860 from ErisDS/issue-3857

Redirect uppercase routes to lowercase version
Merge pull request #3859 from ErisDS/issue-1299

Update editor markdown tests
Fixing settings tests
Merge pull request #3882 from JohnONolan/fix-profile

Fix up user profile