Split out the raven middleware so that it can be added to apps at the end