Add support for table aliases in joins

While being a convenience for long table tables, it also enables a table
to be joined with itself, which is often a useful operation.