Implement Comparable so that TreeSet can work

Also, make TreeSet synchronized because it makes everything actually
work.