Sort function and refactoring

Finished implementing the sort function;
Moved the function to a folder so that tests will fit;
Removed output from the function file;
Made some cleanup, deleting extra files related to the sort function.
Added tests for sort function