apache: cherry-pick mods added in Ia46312071

* Make Ia46312071 smaller and safer by introducing the mods it depends on.
* Make MPM changes do a config test.

Change-Id: If903d5cb39f561203271a87fe192533fb7fd299d