Add initial version
Improve caching, use cStringIO
Remove unused import