Hierarchical contracts implementation

At this time, we only support one level of hierarchy,
although one parent contract can have multiple children.

Change-Id: I09bcef301ccc95e256a0850320680f720b491520