Setter for relations

@greut's work rebased. 

fixes #125