Fixes #2: Not unique table/alias when joining the same table.

It also fixes:

* ClassDefNotFound when running tests
* Not table "alias" found in "SELECT alias.column FROM table AS alias"

And implements automatic tests for basic queries