We study the two-dimensional electron gas in a magnetic field at filling fraction $\nu=\frac{1}{2}$. At this filling the system is in a gapless state which can be interpreted as a Fermi liquid of composite fermions. We construct trial wave functions for the system on a torus, based on this idea, and numerically compare these to exact wave functions for small systems found by exact diagonalization. We find that the trial wave functions give an excellent description of the ground state of the system, as well as its charged excitations, in all momentum sectors. We analyze the dispersion of the composite fermions and the Berry phase associated with dragging a single fermion around the Fermi surface and comment on the implications of our results for the current debate on whether composite fermions are Dirac fermions.