The Geometry of the Master Equation and Topological Quantum Field Theory