added atomic string
cleaned up a bunch of code; added a gcc atomics compatibility header