Use a map for NIF keys

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