Better optimization pipeline
auto merge of #6881 : Aatch/rust/new-passes-2, r=thestinger

This is a better pipeline, both faster-running and produces faster code.

For some reason the `mergefunc` pass screws over resolve. I have no idea why though.