fix hash-handling

Also, make all classes new-style so that __slots__ take effect