Add support for document_atomic_add

The first version of atomic add.

This still has some limitations (to keep the pull request simple):
 - only supports integers
 - can only create new elements if the parent exist

I also did some cleanups you may or may not like. Additionally, I am using a codeblocks project for development. I am not sure if we should merge it.