Logic for adding columns in join() and from()
Changed comments and altered order/group stuff in getUnboundSql()