support forin and foreach. Fixes #6