Fixes for bugs in scalar lifting case exposed by foreach branch
Got prototype implementation of nd::foreach compiling
Add some more foreach tests