javascript code that splits entries in an array and orders alphabetically.