added ability to use sort order in CSV

This adds the ability to use the sort order in the CSV output. Resolves issue https://github.com/activeadmin/activeadmin/issues/3269
Is there any way this could be extracted out into a separate method? This makes `build` quite hard to understand.