Word Matrix Rewriting Systems