Simplified implementation of famous Mark and Sweep Garbage Collection algorithm.