Association callbacks

Needs more tests.

Fixes #8.