MSQueue/MoirQueue refactoring (phase 2, not completed)