Fix byte array persistence in Mongo.

* Added test case (for all impls)
* Refactored code for persistence of simple types to avoid serializing DBObject using unnecessary recursion.
* Improved detection of Mongo native types in general.
* Updated BasicArraySpec with additional test cases.