fixes and refactorings
adding some tests
some fixes, and our first basic tests pass
cleanup
adding limit test
Pretty much there for nested selects.

We can now do nested selects along with their join conditions, which are abstracted in a way that hopefully will be easy to use on the server side. Some fixes to the code, and a simple test.