Added option to specify synchronizationcontext when registering callback