More code cleanup, defensive coding, and method extraction.
Updating to the last upstream changes (merge branch 'master' of https://github.com/saebyn/munkres-cpp).