Generation of comparison functions from types

Part of the Jane Street's PPX rewriters collection.
