rebase one-to-many support

I simply cherry-picked 0c1c7df, after checking out master
There were merge conflicts, but I did my best to resolve them, as I do not have a good understanding of your code.

Please review this PR and let me know if there is anything I can change.

Thank you.