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.
The issue with this is that the opt out helper takes in an account when processing a message. We don't use it yet, but we will soon. I don't know how possible it is for us to get hold of accounts in the middleware in a way that does not perform badly (that is the reason for this PR's change in the first place).