Improve the JSVal interfaces.

This duplicates some more knowledge of the JSVal representation into rust; I think that's fine, as the representation rarely changes, and this makes for cleaner and more efficient code until we have cross-language inlining.