Finalize the X.matrix and X.vector classes with documentation and tests.