Add atomic inc/dec and test functions.