Implemented a function to extract all variable nodes from a given instance link according to its pattern link.
Only extend patterns with shared variable nodes.
Added logic that the children pattern should carry its parent's shared nodes too.
Changed the parent links to a set.
Added more debug messages.
Added test Pattern Mather ouput link order.
Merge pull request #893 from shujingke/PM

More debug on Pattern Matcher.