HUGE speed improvements to dual mode tests
Move validate notebook state into utils