code refactoring + integrate rdesktop code for bitmap decompression