ipdb: transaction callbacks

Transaction callbacks can be used, e.g., to check the environment after the
transaction is applied, but before it is commited. You can check, if the
network is reachable after the changes, and if not — the callback exception
cause whole transaction to be rolled back.

Also, unit tests added.