added log view; periodic update; constants; setScene javascript api; tidied up internal javascript pwl & distance