Map behavior

Fix #554 and #556.

Simple O(n^2) search for now. As noted in the commit messages, a better long-term fix would reimplement the Map type on top of a hash table instead of a vector, but per the roadmap it sounds like correctness is more important than speed for now.