Added support for for-in and for-each.
Improved code and fixed bugs for recent functionality.

Change-Id: I750e49bc5d84ee20b3a04d11ffbc0c3322fd4801