Tidying previous commit
User exit functions
Session restoration + notify JP when CJ exits