First working Join prototype.

Lots of little changes which I will inspect tomorrow.