BSON module taken from here: https://github.com/martinkou/bson