Refactored stack/security out of the mix; temporary home for some new authn related middlewares.