sm-map: Update key indices properly after remove().

Also reorganized some functionality into protected methods to expose it
to subclasses.
sm-map: Allow each() iteration to be halted early.

…by returning `false` from the callback.
sm-map: Add merge().
Build sm-map.