A projectively normal Calabi-Yau threefold $X subseteq mathbb{P}^n$ has an ideal $I_X$ which is arithmetically Gorenstein, of Castelnuovo-Mumford regularity four. Such ideals have been intensively studied when $I_X$ is a complete intersection, as well as in the case where $X$ is codimension three. In the latter case, the Buchsbaum-Eisenbud theorem shows that $I_X$ is given by the Pfaffians of a skew-symmetric matrix. A number of recent papers study the situation when $I_X$ has codimension four. We prove there are 16 possible betti tables for an arithmetically Gorenstein ideal $I$ with $mathrm{codim}(I)=4=mathrm{reg}(I)$, and that exactly 8 of these occur for smooth irreducible nondegenerate threefolds. We investigate the situation in codimension five or more, obtaining examples of $X$ with $h^{p,q}(X)$ not among those appearing for $I_X$ of lower codimension or as complete intersections in toric Fano varieties. A key tool in our approach is the use of inverse systems to identify possible betti tables for $X$.