Refactor the callback implementation

Instead of registering the callback directly to the core API, the public API now has a CallbackHandler class that handles the callbacks. The native API invokes the on<Callback> method for
each action, which in turn invokes execute() on each attached callback.
Fix compiler warnings for 32 bit systems. These were due to casting a 64-bit int to a
pointer.
Adjust the test client to the new Callback API