Move sessions out of the database

Fixed #10