fix `remove-duplicates` prim (works on Nashorn too now)

the old code assumed that when you iterate over the key-value pairs in
an object, the keys always come back in the insertion order. not
guaranteed by spec, and actually failed on Nashorn
serialize shapes using integers

this avoids Rhino/Nashorn incompatibility in how numbers print.
Rhino was adding ".0".  V8 agrees with Nashorn, so that makes
Rhino the goat here.
use JSON.parse rather than inlining JSON literals in code

this is safer (since it verifies that it's really just JSON,
not arbitrary code)

also, the old code was failing on Nashorn with large JSON literals
because we overflowed some code size limit