Various fixes from the last commit.

There were a ton of bugs introducted (as expected) in the last commit.
This fixes them.. samples include:
	- Being an idiot and forgetting how static variables were defined in
	  Python
	- Accidentally chopping \r's out of gzipped messages (breaking them)