The Luminosity and Mass Function of the Trapezium Cluster: From B Stars to the Deuterium-burning Limit