Implement mark-and-sweep GC

closes #2