Fix insufficient cache size in rare cases

Cache is now resized (as it should be) when maximum input is exactly equal
to size.  Renamed the parameters so as to make the distinction between
'max' and 'size' clear.
Code cleanup

Consolidated the *_load functions into a macro and added a fflush to the
warn function.  NDEBUG is now enabled by default in the makefile.