NH-1452 - Add support for property-ref keys in join table

Original patch by Daniel Guenter @Nicaog was applied with code cleanup and minor fixes