Various changes to latest state.

Added more tests.
Swapped single instance protection for a SharedMap based alternative.
Added basic Monitor functionality.