Categories for Homotopy Theory and Rewriting