Error notification if send mail api returns 500

closes #3728
- If the mail config is broken, the ajax call will fail with 500 and
not return an error.
- This change catches 500 and wraps the error in a notification.
Restore email templates in npm package

no issue

- apparently npmignore's globbing rules are different to grunts. The rule *.html has been interpretted as all html files and the email templates are missing from the npm package.
- this fix tells npm not to ignore email templates, so that they will be present in the next release
Hide role dropdown on user page if user is owner

Closes #3764
Display correct new Ghost version

closes #3790
Version bump to 0.5.1-1
Ensure Owner's role isn't downgraded

closes #3765
- Simple API check to ensure that the owner isn’t downgraded to a
different role (analog to the ’can’t change your own role’ check)
- Test added to ensure Owner can't be downgraded to a lower role
Post Settings: No 'Author' selection for 'author'

closes #3756
- The post settings menu’s option to change the post’s author isn’t
displayed if the user has the ‘author’ role.
- Also fixed some incorrect indentation in the template (no actual code
change)

Conflicts:
	core/client/templates/post-settings-menu.hbs
Fix broken status code

closes #3779
- added custom error classes for OAuth errors (bug was caused by
oauth2orize error classes)
- added basic tests for `/authentication/token` endpoints
Version bump to 0.5.1-2
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.
Delete tokens before deleting a user (when)

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
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
Importer: Sanitize UUIDs

Closes #3844
- Before importing, all data is checked for incorrect UUIDs. If check
fails, data is sanitized and outfitted with correct UUIDS.
- Scaffolding allows for easy implementation of additional
sanitization, should that be required in the future.
- Test included, old tests updated.
Upgrading Casper to 1.0.1
Uncapitalise middleware should not affect tokens

no issue

- Whilst testing on next, I noticed trying to signup didn't prepopulate email addresses any more, and this is why
Version bump to 0.5.1
Remove master warning from stable branch
Merge remote-tracking branch 'upstream/stable' into stable
update compiled files