Add sort function for lists

Added list.sort() method. Checks if the list has numbers and sorts them in ascending order or lexicographically otherwise.