Fix JS warnings for console.log() in cases where there is no window.console; Optimize $( 'body' ) usage