Hyatt pointed out that it's awkward to use iterators to find something and then get the value and remove it. Instead he'd like a take() function built into map that does the job. I'll add it.
Created attachment 17004 [details] patch
Comment on attachment 17004 [details] patch r=me
Committed revision 27385.