Simultaneous versal deformations of endomorphisms and invariant subspaces