Add OpenCallback.

Use boost library to implement some features.

Bug fixes.