attempt to speed up extract_fmap more

rather than extracting the fmkeys first, then creating a lookup theorem
(at linear cost) for each key, which is in total a quadratic algorithm,
attempt to do a single pass down the map collecting the theorems. it's
not quite linear because the theorem passed down the recursion grows as
many hypotheses as there are keys, but it should be much closer to
linear.