Base64 can contain / characters

So they shouldn't be written to disk as is. The _ character is not part of b64 so we use that instead.

This fixes a really annoying bug in Cloud9 https://github.com/ajaxorg/cloud9/issues/2005