add a bunch of modules and tests from nxmctree, to be converted to use dense matrices