Extract format module

Extract formatting utils used by unhandled rejection reporting, and add some unit tests.

See also #412 
I'm sorry but I've got one more little question: is this a Node/browser detection? If so, why only CommonJS `require` is used below to get the `format` module? If not, and you've got CommonJS in the browser, too, why don't you always get `buster` from the module system?