docs: util.js

jsdoc fails to produce HTML output past the first few typedefs, so I
probably haven't followed the jsdoc syntax.  Good enough for reading the
code, though.