Refactor and better document code.
Add support for no atomic int's, std::atomic, and no threads.
Add performance test case.