Added sort.js and some functions

sort.js is part of the algoritum and I added a sort function.