Added compile time switch to enable in-memory caching of entry index.

When turned on via USE_ENTRY_CACHING option it will allocate
a map(or unordered_map with gcc/clang) from entry name to entry id.
It makes looking up an entry faster.