bind model context to lifecycle callbacks

- resolves #230
added quick unit test for lifecycle callback context