Added a callback closure in the setting.

Added a closure in the setting. It allows to do custom server-side actions without editing the lib itself, and allow upgrade. Needs php5.4.