Add logging.
Update tests to run in browser as well as node.