DBM-related changes

I'm making an effort to incorporate the changes I made in my fork of Pylearn2 into the original repo.

This pull request concerns changes made to the DBM framework, namely:
* Make it possible to change the RNG in DBM-related costs
* Factor out the sampling procedure in order to allow allow fancier sampling procedures