switch db to redis; other minor changes.
finished changing all the db calls to redis format.