Protect cached XS state with a mutex

We want to avoid creating an extra XS client unnecessarily.

Signed-off-by: John Else <john.else@citrix.com>
Remove spammy logging (again)

Signed-off-by: John Else <john.else@citrix.com>
Refactor xenstore handling

Move the Xs module to the top level, and out of the Common functor.

Signed-off-by: John Else <john.else@citrix.com>
Add new asynchronous interface

Add new module Reporter, which allows us to create values of type
reporter which can run asynchronously until we want to cancel them.

The interface of the Common functor is largely unchanged, but
internally it now makes use of the Reporter interface.

Signed-off-by: John Else <john.else@citrix.com>
Move exec_cmd into Utils module
Tidy up docs

Signed-off-by: John Else <john.else@citrix.com>
Rename module Common to Process

Signed-off-by: John Else <john.else@citrix.com>
Remove some code duplicated across the two mainloops

Signed-off-by: John Else <john.else@citrix.com>
Merge pull request #6 from johnelse/async-interface

Add new asynchronous interface