Add methods to calculate the assignment and get the sum separately

Functionality and usage of hgAlgorithm remains the same.
Also fixed a typo in the documentation and renamed a variable.
Original tests utilize the new functions, so nothing seems to have
broken.
Use maxWeightPlusOne instead of a fixed forbiddenValue

This way, the value that pads rectangular matrices is chosen
based on the input matrix instead of requiring all input values to
be positive, or all less than -1.  Documentation was updated to
reflect the latest changes as well.