Add ability to write to StringIO and cStringIO objects

I wanted the ability to write to strings and it seems like this was the easiest way. I considered separate frombytes and tobytes functions/methods but generally this seemed like the easier solution with the least duplication