Add beginning of explicit allocation representation.

This involves extending the types, unfortunately.  The new 'mem' type
should eventually go somewhere else.
Also run Cabal test suite.
Commit before it breaks!