Added saving and restoring session feature. Fixes #19.

Tested in Linux only.