Replace MemoryIndex with hand built code

This code lies more then memory index but it is faster and doesn't lie
enough to break the FVH.

Also add term filtering to the analysis which saves a ton of time.