implemented local caching of votes

todo: at specified intervals, send cache contents to backend and then
flush the cache. Backend updates the DB accordingly