Use Arel for table aliases in joins

When joining taggings across multiple tag scopes, we need to keep
unique table names else they will overwrite conditions.
Cleanup, optimization, small fixes