generalize store_as, also use it with AnyDict.
use six for StringIO imports
docstring tweak
minor cleanup
make AnyDict store_as customization work