Statistical Mechanics of Hard Ellipsoids. I. Overlap Algorithm and the Contact Function