Doco
Initial attempt at a callback style which handles connection closing automatically.
Move all methods to the new callback mechanism
Use this, which is less verbose.
Reformat code and remove warning.