Option to preserve or not references between OS sessions.

Along with tests.