Documented util.js

Several other small fixes.