reenables caching which was effectively disabled in the last commit
correctly handle lcp > 1
fixes caching

These changes reenable caching. Now andi should be as fast as in version v0.6 and as accurate as in v0.5. (hopefully ;)
caches even more