Bug fixes in the sort function and preprocessing function

The compare used for the sort was not an acceptable sort function.
There is an array out of bounds error in preprocessing.coffee. The fix
is a hack, but at least the program dosen't error now. Selecting the
'Emergency Room' Event in the example dataset will produce this error.