Use bson file format to load and save fence

- fence file bson formatted
- make bson callable from c++