Add built-in for traversing maps.

Plus other clean ups and changes.