JS backend: hashCode and toString cleanup