Fix namespace used for atomic operations.
Commit test case.
Refactor into class-based details, and split big tables off into new header.
Move unchecked_bernoulli_b2n over to new header and add to tests.