Refactor sorts

I changed the sorts to all inherit from a base class, since most sorts have a lot of the same properties. I also including NestedFilter and NestedPath in the base, since we use those with our sort scripts in elasticsearch.  This pull request also includes the changes in PR #817 since those are more minor but still caused merge conflicts for me.