Finished implementing functions in util.js, and tests for util.js