Make the atomic operation a function.

Make the atomic operation a function so that it is explicit. It is also
easier to document the fact that the atomic operation must not be
asynchronous if you specify it as a return value from a function with no
arguments.

Closes #20.