1. Unbreak py3k support by using portable idioms.
2. Be more conscious of memory usage by garbage collecting unused
memory and by using iterators for reading in data instead of slurping
in the entire file. This should get memory usage well under 2GB like
I've seen in the past under some circumstances.
Signed-off-by: Garrett Cooper <email@example.com>