Create a reversed map id -> index for faster searching

An attempt to solve the issue #30