This commit adds python code to call javascript_examples.js in its two supported modes. tools/test-api asserts that the example output is as expected, whereas the API markdown extension is used to render these examples in the docs.