cdf append to file

Adds the 'a' mode to allow opening an existing file for reading and writing.

  This patch includes the patch to fix global "string" attributes in python 3.