Move some mdrun code out of gmxlib/