Added saving/loading state functionalities in addition to greater logout functionality.