Issue #6 Refactored SingleHandler to make it immutable

I had to manually override equals and hashcode for the anonymous `Type` object, since I cannot store a `Class` as a field if I want it to be immutable.