  Future astrophysical datasets promise to strengthen constraints on models of
inflation, and extracting these constraints requires methods and tools
commensurate with the quality of the data. In this paper we describe ModeCode,
a new, publicly available code that computes the primordial scalar and tensor
power spectra for single field inflationary models. ModeCode solves the
inflationary mode equations numerically, avoiding the slow roll approximation.
It is interfaced with CAMB and CosmoMC to compute cosmic microwave background
angular power spectra and perform likelihood analysis and parameter estimation.
ModeCode is easily extendable to additional models of inflation, and future
updates will include Bayesian model comparison. Errors from ModeCode contribute
negligibly to the error budget for analyses of data from Planck or other next
generation experiments. We constrain representative single field models (phi^n
with n=2/3, 1, 2, and 4, natural inflation, and "hilltop" inflation) using
current data, and provide forecasts for Planck. From current data, we obtain
weak but nontrivial limits on the post-inflationary physics, which is a
significant source of uncertainty in the predictions of inflationary models,
while we find that Planck will dramatically improve these constraints. In
particular, Planck will link the inflationary dynamics with the
post-inflationary growth of the horizon, and thus begin to probe the
"primordial dark ages" between TeV and GUT scale energies.
