Fix test where included as incorrectly used
make consistent use of as when creating associations and flag aliases
getAssociation finds by alias if provided
refactor validateIncludedElement to utilise altered getAssociation
refactor quote function to use getAssociation
Merge pull request #1365 from overlookmotel/order-by-associations-refactor

Order by associations refactor