Add hooks for callback timeouts and failures

This commit adds a new Callback class which can be used instead of a simple function for async callbacks.

Note, simple functions are still fully supported.

With the new Callback class you get
- required on_success callback
- optional on_failure callback
- optional on_timeout callback

not yet done:
- detecting failure
  - this requires a failure protocol to be written
  - maybe an object like {'exception': 'exception.class.path'} or something in the response data.

problems this solves:
- I have been having the "autoformat" functionality hang on me frequently, this will abort that with a 1 second timeout.