use classic js for deviceready and move it out of document ready

Signed-off-by: Floyd Pink <imbleedingme@googlemail.com>
tweak the trace methods

Signed-off-by: Floyd Pink <imbleedingme@googlemail.com>