Added multithreaded upload support.  Added a unit test to verify multithreaded uploads with up to 32 threads.  Minor thread safety tweaks.