Converted trust.py to OCaml

Currently only used by the unit tests.