Convert remaining callers of do_force to C++

Major callers are converted in other patches.

Removed unused variables, used std::min/max, named constants, put
maximum length on sscanf floats.

Introduced an instance of bMaster. Initialized gstat to and later
checked for NULL before use. These help static analysis reason
correctly. Previous code functioned correctly in practice, but correct
analysis would require cross-function analysis that cr, when passed as
non-const, is not actually modified. Fixed a warning about stepsize
not being used in L-BFGS, and added more comments to this algorithm
while editing the code to help us understand what it does.
The predict_shells() function has been modified to use the
gmx_mtop_atomnr_to_atom() call for case 2; the previous version would
use an uninitialized pointer.

Fixes #1593.

Change-Id: I54f238cedc78aadb0dad080ea3b28f001dce8d94