Added type info + helpers. Consolidate elewise looping macros into do-elements-loop in domain namespace
Remove commented out code
Move data typechecking to types namespace
Tweak printing to help debugging.