Simplified the loopback example even more

The loopback example now takes a lambda as argument. Also added a
method to change the callback at runtime. This might still need some
work w.r.t. synchronization.