Various fixes + additions.

Added ObjC wrappers around locks.  Modified atomic containers to be
more generic by using composition.  Fixed missing includes.