Base class for the various backend implementations.
Implements callback registration functions and defines the main backend APIs.
If set, these are called just before and after the backend waits for an event.
If an error is thrown from these callbacks then it is reported using
master()->handle_error()- it doesn't interrupt the operation of the backend.