This changeset includes changes in relevant classes to make them easier to test.
Faster, thread safe, a hell lot cleaner.