Adding random and format functions to utils.js

Definitions [here](#L7R36) and [here](#L7R47).