Basic support for callbacks

Also a minor but maybe controversial thing - in order to wrap and unwrap unhashable objects (in my case this was a some_dict.get method as callback), I store them in identity_dict.