Made iterative relaxed inference modular, i.e. new inference algorithms
can be added conveniently.
To Do: remove bugs.