Bug 1023730 - Move modifyLayout() to layout_manager.js +shepherd

If possible, please help extract this "expected" result out as a shared variable, and use it / modify it to a specific one for each special case.