JS code tidying
New minified from master branched