Cleanup
Use set and get instead of write and read for sessions
Added documentation