ENG-5051: Review fixups:
- Narrow the exception type thrown by stringToLong so it can be
  distiguished from other, future, disasters
- Additional safety/sanity checking that the thing we want to convert
  into an integer type is actually an integer type and converts to an
  integer type.