Negatively Charged Oxygen Ions as a Plasma Diagnostic Tool: Application to Comets