[MAT-464] Add docs to the dogma class.

This adds a first attempt at documentation to the DOGMA class.
All functions now have some form of doc string.

Notable missing documentation is the theory behind using such
a class e.g. forming trees and materialising.