Added tests for more complex scenarios. and made them pass.

Tests define behaviour for scenarios such as branching trees and
unconnected sets of types.
Merge branch 'dev' of github.com:intermine/intermine into dev