Fixing memory leak.

Yes. I said memory leak. In a python program.
Removing redundant assignments
Added a set of stuff being observed by the Memory class
Added some code to break a reference cycle