Sort fixes

* Split sort_by_key instantiation into multiple files
* Changed dir to isAscending in all sort functions

Fixes #203 
Fixes #204