Massive update to MasterPortfolioWriter, which fixes problem where portfolio nodes are not populated with positions
in some cases.