String Diagram Rewrite Theory I: Rewriting With Frobenius Structure