Make encode_value check for atoms first.
Make encode_value check for atoms first.

This commit makes encode_value substantially more
performant for any input which has more atoms than
composite types, this is probably a reasonable
assumption for most real world applications.

Benchmarked encoding arrays with 10000 integers
and 10000 strings.

encode old code: 6.91841602325
encode check atoms first: 2.35213804245

martinkou/bson