Change type.js to have a richcompare for type comparisons