Fixes #2496 (simple caching to speed up quickopen/go to definition)

Improves the speed of quickopen/go to definition #2496 by adding simple caching for StringMatch and in the go to definition extensions. Take a look at go to definition for codemirror.js with the devtools open and you'll see the biggest improvement, but this change does just generally make quickopen and goto definition snappier.