How do organisms survive and function despite metabolic activities that tend to shift ph toward either acidic or basic ends of the scale?