Interface change

This is a rebase of gh-3066 on top of today's master.

I set up this branch in lisa-lab/pylearn2 so that other people can start working on it, or start from there to implement other things.

Previous comments from reviewers and from me are still in the original pull requests, which are now closed.
- gh-233
- gh-265
- gh-296

Tests pass with floatX=float64, one test was failing with floatX=float32 (see https://travis-ci.org/lisa-lab/pylearn2/jobs/7819957#L9288).