Add simple callback mechanism.

If we need more features, we should use boost or libsigc++ or something.