Add logging library to the javascript.

It is similar to the android logging library, with support for indentation while entering and exiting function calls.