Add some tests.
Fixed corruption in garbage collection.
README formatting.