Fixes #1393 - don't use Number.MAX_SAFE_INTEGER
Created by: davemevans
This is fairly uncontroversial - see discussion in #1393 (closed).
I have used a module from npm which we have done with isoboxer but not something we do all the time in this project, and I'm not really sure why. Perhaps the project grandees have an opinion.