Cache fixes

Fixes bugs, including fixes removed from NetworkAtomics (whoops). See individual commit messages.
I'm not completely convinced this is safe. The old code would have use the default memory_order_seq_cst for sequential consistency. Why was that overkill? (This goes for add(), sub(), and read() as well.)