Clearer logging

Made the changes as suggested.  The very last change set is the de-inlining of function calls, not sure if you want that change set also.

This is my first stab at Javascript so not 100% sure on what good idiomatic JS is meant to look like :)

selftest is clean.

cheers
Jason