Improved thread-safety in a number of locations, fixed issue with transaction journaling and cleanup.

Signed-off-by: gburgett <gordon.burgett@gmail.com>