Implement Key Comparison

Make keys comparable for equality and also enable them to be sorted.

This fixes #27