Implement callbacks

Major rewrite to implements callbacks. This allows for multiple calls
to be made in parallel.
Add examples