Added context-data to callbacks.

Also style/warnings/compatibility-related changes.