Added parentKey

This seems to work for my case, which is objects with single parents. 
Sorry about the 2500 line changes - github has somehow treated all javadoc as 'changed' and I cant stop it. There are only 10 lines or so of actual changes - Rob