Change type references to self.__class__ where able.
Move hexversion checks out of methods
Change SortedList.bisect to equal SortedList.bisect_right