A dissertation submitted to the Stanford University Department of Computer Science and the Committee on Graduate Studies in Partial Fulfillment of the requirements for the degree of Doctor of Philosophy.