[wip] More tests and documentation.