Added database and implemented storing tokens between sessions.