Remove dependency on foreach. Move MASS and numDeriv to Imports. Fix
lingering bugs in imidasreg.R