add infrastructure for storing Principal Variation (PV) as a stack
clean up memory module