packElement - buffer checks when serializing Code() and functions

I ran into an issue when trying to serialize a `Code()` object when using the browser version of bson.js on Chrome 25 (Debian 64-bit).

I was getting an error that there wasn't a `write()` function.
I dug in and noticed that in some places in `packElement()` where functions were serialized, there was a check to see if buffer support was available before attempting to use `buffer.write()` and others that it wasn't.

I attempted to create a test case for my scenario, but ran into massive trouble running the browser tests (objects not found, etc.).

Basically, I'm creating a `Code()` instance inside a complex (BSON) Javascript object and then just attempting to serialize it.
```javascript
obj["javascript"] = new Code("function() { return 'Hello World'; }");
BSON.serialize(obj, false, false, false);
```

I noticed this differed from the primary test case, in which a scope was declared for the `Code()`.

I was able to make the error disappear by changing the lines that used `buffer.write()` without checking for buffer support to the `supportsBuffer ? buffer.write(functionString, index, 'utf8') : writeToTypedArray(buffer, functionString, index);` line. It seemed benign. I am able to correctly serialize and deserialize BSON documents over the wire, so it seems to work for me. Note that I have not tested it in any other scenario.

Please forgive the whitespace/line ending changes, you might want to just look at the last commit in the branch.

Thank you for your work on js-bson, cheers!