The purpose of this paper is to develop constructive versions of Stafford's theorems on the module structure of Weyl algebras A (n) (k) (i.e., the rings of partial differential operators with polynomial coefficients) over a base field k of characteristic zero. More generally, based on results of Stafford and Coutinho-Holland, we develop constructive versions of Stafford's theorems for very simple domains D. The algorithmization is based on the fact that certain inhomogeneous quadratic equations admit solutions in a very simple domain. We show how to explicitly compute a unimodular element of a finitely generated left D-module of rank at least two. This result is used to constructively decompose any finitely generated left D-module into a direct sum of a free left D-module and a left D-module of rank at most one. If the latter is torsion-free, then we explicitly show that it is isomorphic to a left ideal of D which can be generated by two elements. Then, we give an algorithm which reduces the number of generators of a finitely presented left D-module with module of relations of rank at least two. In particular, any finitely generated torsion left D-module can be generated by two elements and is the homomorphic image of a projective ideal whose construction is explicitly given. Moreover, a non-torsion but non-free left D-module of rank r can be generated by r+1 elements but no fewer. These results are implemented in the Stafford package for D=A (n) (k) and their system-theoretical interpretations are given within a D-module approach. Finally, we prove that the above results also hold for the ring of ordinary differential operators with either formal power series or locally convergent power series coefficients and, using a result of Caro-Levcovitz, also for the ring of partial differential operators with coefficients in the field of fractions of the ring of formal power series or of the ring of locally convergent power series.