Fix bernoulli distribution sampling, and add test

Previous version was almost always sampling 1
Merge pull request #27 from david-durrleman/development

GH-27: Fixing bernoulli distribution sampling