Port 2.12.x changes

Ported all changes from 2.12.x branch to 3.0.x.  Most are just straight code copy, but a few required design changes