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