Various fixes to FFI use, and a change to Collection::rand

* Missing imports were not detected by the old FFI
* The new behavior of Collection::rand is more consistent with other methods such as Sequence::first and []

Passes all tests after merging with master: http://gresil.org/jenkins/job/CI%20Alexis/17/