added GistCache and tests. working towards #6.