Clean-up comments, update js localhost detection