Add LoggerClass to JavaScript and cleanup some JavaScript code