Added type synonym Dim for [Size] and removed kernel maps and whatnot from Gen.hs
Initialization loops with malloc for multi-dim arrays.
inserted when to avoid generation of superfluous loops.