Master.php and factories.xml cleanup, refs #915