Enforce correct ES5 parseInt behavior, with tests.

Fixes #193