Use a map for NIF keys

Store NIF keys in a map using time as index instead of a vector. This accelerates searches and gives a sizable performance boost.