Regarding the sorting stuff, @tmertens and I chatted and he may have a solution we're going to try tomorrow.

Regarding the mainline-friendliness, we should probably just make all of our changes optional/configurable wherever possible. For the port example, perhaps we could only strip it if the proper config was in place.