Resolved some thread-safety issues.  Added an example/marionette test.