Add auto-merge feature to child contexts

With these codes, child contexts could merge changes from parent
context when parent context were changed.