Refactor: matrix stuff moved to rbbt-dm