Add much more flexibility to express/HTTP middleware configuration.
Fix issues to make the new config actually work.