Move return handler elimination to optimizer.

It already is doing the analysis we need to do a better job than it is
possible to do in the actions. Thus, have the optimizer toss unneeded
return handlers, and clean up Actions.pm quite a bit thanks to this.