Allow the use of a Proc to decide if the middleware is enabled

This allows for the middleware enabled state to be controlled via a Proc if need be

@csfrancis @fbogsany makes sense?