WIP Checkpoint: refactored, extracted DB code into separate module, started work on persistent session storage