Refactor: merge txdb into lr; lazily compute everything
test test test