Refactored lzwEnc and xhrImg to sensible homes