Change cache by LRU cache to fix memory leak

We've change the cache by an instance of simple-lru cache to fix a memory leak, 
We've also change 
str = new StringDecoder('utf8').write(str); 
by 
str = new  StringDecoder('utf8').write(str.toString()); 
to fix test error

Please tell me if it's some thing wrong

Regards.