Started refactoring session-dir handling.
Syncing with def_treemap