add sortByAttributes for collection

I added the sortByAttribute function as a quicker way to sort the collection. I use it in my projects. Thought it would be nice to have it as a default.