Separate optimization from statistic redux

This is a rebased version of #1914.  I decided to go ahead and make a new PR so that it can easily be run through Travis and the like.  Otherwise no major differences.  Once the CI gives us a green checkmark this should be merged instead of #1914.
Turns out it is covered by the test `test_fitter_against_LevMar`, but I'll add another explicitly for that fitter.