The Search for Certainty: A Philosophical Account of Foundations of Mathematics