An Algebraic Framework for Stock & Flow Diagrams and Dynamical Systems Using Category Theory