Mostly done with compress

The only thing left (I think) is to figure out how to return the number
of bits written to the file. I think this is correct though. I also am
not sure about a lot of the stuff in there, so check it out and let me
know.