Support writing objects that are not strings

I had some "undefined is not a function" when I tried to create attributes that were floats, because you can't invoke split() or join() on them.
This small commit fixes this problem.