JS core: support optional write method for the log output
core-demo.js: define write method for the log output
core-demo.html: append link to the JS source