Correct representation of wchar_t's max value.
Remove IntegerStack.

std::vector is a reasonable replacement.  Also changes representations
to be references instead of pointers to simplify memory management.
A few more miscellaneous fixes.
Remove unused class Triple.
Replace Pair class with std::pair.