Cleanup some EntityStore JavaScript code

Idx next to id is confusing (could mean "id extended").

It's not the expected number of returns if it's minus one.

Change-Id: I096c3f4b3eada845371ad6d80ec0d8841277dd32
Merge "Cleanup some EntityStore JavaScript code"