Moved list push/pop into their own functions.
Added a couple of atomic operations with implementations for Windows, Linux and OSX.