lazy handling of grouping in join functions. closes #66