Added state checking to JSONWriter
Added BSONWriter.Context and made JSONWriter.Context & BSONBinaryWriter.Context to extend it.