stable stringify

This patch adds some failing tests for non-deterministic stringify and then patches them using [json-stable-stringify](https://npmjs.org/package/json-stable-stringify).