Enhance debugging, matching, and error checking

Added more information to debug mode statements.
Added more intelligent matching to improve compression.
Added more error checks to catch program bugs.
The compression/decompression now works again.