Some attempts at making memory use better. Start on listing sessions more sanely