Clean up unit tests, remove dependence on session var