implement select for new regal api
fix chained joins, change table inheritance around a bit