Made qkeyToIndex/indexToQkey use a two-tiered lookup table to avoid needing JSON.stringify