Implement frexp and ldexp. In JavaScript.

Handles subnormal floats. I googled but none of the hits had a correct
implementation.