Rename getUint32 to getInt32 and collect readInt*() in util.js

Fixes #4553 and collects duplicate readInt[16|32] functions in util.js.