upate middleware logic after pull/387; convert connection middleware to new priority syntax
Merge pull request #392 from evantahler/middleware_updates

upate middleware logic after pull/387; convert connection middleware to new priority syntax