refactor session, add config, using gob instead json