Fix serious bug: deserialized collections all had hash code 0!

Also, remove some useless methods, and minor cleanup.