Various fixes
Added a whole bunch of new features. Beginning of garbage collection.