Beta.  Nominally functional.

Beta version of get_h().
The inequalities need some work, since the results the program
gives seem too large to be possible.
Otherwise, it seems to be functional.

Calculating the "maximum" value in get_h() is perhaps a premature optimization,
but it also seems to be clean code.
All the variables needed to calculate "maximum" are bound at the time
of calling get_h().

The real magic is the last line of get_().
This aggreagates all the functions generated prior into a single
lambda function that can be passed to sqp().

Refactored ui.m, damage_p() and calculate() to use the new get_h().

Since this means no longer referencing the "stats" and "bonuses"
variables from @(h), this made it possible to remove a lot of duplicate code.

Most of that duplication is now handled in calculate().

Further refactoring along these lines should still be possible (and desireable).