JSON to BSON and vice-versa