Flush with delay

Added test scheduler support for time delayed actions
CAS
Make the commands more atomic

Use concurrent dictionary and atomic operations to ensure that this is
more threadsafe