Remove some dependencies with boost; rewrite some parts of Matrix<T, N>