Made CoreBag iterable and added a test.