Major overhaul of fits and modelfit