Cpr preconditioning again

This is the same code as #85, but updated to be possible to merge.

Suggestion by @bska and @andlaus in #85 have been incorporated.