Implement {map,set}.{size,empty}. Fixes #1648.
Better {set,map}.forEach tests.

Adapted from @DanGoldbach’s fa618397f6f09c274c72b11dcd91800456d1604a.
Simplify.
Consolidate duplicate code.