Calculate initial documents, first attempt

Basic tests and `const mempty` implementation.