Add before/after advice to factory. Closes troopjs/troopjs-core#69