Backed out attempt at fixing memory management. Need to implement simple reference counter.
Working on supporting basic ref counting.