Bug contract workflow

Fixes the bug that prevented to reach terminated state of a compassion contract. Some hooks added for adding code on contract activation.
Good to add context in method definition. Why not use it in write function call ?