began refactoring nfaToDfa

After these two small changes, nfaToDfa is a tiny bit less painful to
read, and these are the first steps to move away from nested while-loops.

added unsafeFind: 'a map -> Key.ord_key -> 'a
(could be part of a Map utils functor?)

changed findStopStates to accept params instead of reading local refs
continued refactoring nfaToDfa

Using List.app: ('a -> unit) -> 'a list -> unit is a much more concise
way of iterating over a list than incrementing local refs in a while
loop; the inner loop over the elements of the alphabet is easily
replaced in this way.