Implemented simple garbage collector.

Simple mark-and-sweep GC has been implemented.