Checkpoint for new js stuff.
Checkpoint
more js
Maybe this is better
Nothing works but this shows more promise.
Fix sort
Fix logging.
Not sure what this code was supposed to do.