Change routing table dispatcher to handle opt outs

At the moment, we rely on an opt out middleware attached to the routing table dispatcher for this. The plan is to move this handling onto the routing table dispatcher. This will help make #1127 possible.
Applying it more than once is probably fine though, so I guess we could leave the middleware around and just not try modify it to use the helper.