Move middleware functions into middleware module and create associated tests
Note: this only moves middleware functions that have associated tests.
document inability to be run on a path below an URL with a hostname - as discussed in https://ghost.org/forum/installation/341-how-do-i-run-ghost-on-a-subdirectory
Fix page errors during builds.

fixes #1434
Merge pull request #1423 from henning/feature/document-subdirectory-inability

document that url currently must not have a path suffix
Merge pull request #1435 from halfdan/1434-page-errors

Fix page errors during builds.
Displays alert if editor is dirty before unload

closes #1327
- Prevents user from accidently losing changes
Moving dirty editor handling out of uploadMgr

issue #1327

- just moved to be in editor obj, everything else is the same
Preventing incorrectly shown unload alert

issue #1327

- IE9 fires an unload when using Backbone.history.navigate which meant the alert always got shown on first save when the url changes from from /editor/ to /editor/id. Not sure if other browsers do this, but this workaround fixes it
Merge pull request #1331 from zacgeis/dirtymessage-fix
Merge pull request #1372 from hswolff/cleanup-middleware

Move all middleware into middleware module.
Test file cleanup on accoutn of OCD
Rename rss file to prevent errors confusing output

issue #1434

- This is a hack until we can get a PR merged into casperjs
Show "Write a new Post" message when there are no posts

closes #1308