added compress and uncompress functions

My first attempt to edit an egg, not sure about that hack for 'unsigned long *'.
I'm in a rush now (added this just because the older functions are leading to segmentation fault), but probably will try to improve it later.