Small invariants in Rewrite code.
Removing dead code in Rewrite.
Remove duplicate code.
Lemmas/Pfedit: use full evar_map instead of universe contexts to start proofs.

As simple as this looks, there's been some quite subtle issues in doing this modification, there may be bugs left.
Remove the deprecated open-constr based refine.

That is [Tactics.New.refine]. Replaced it with a wrapper around the primitive refine [Proofview.Refine.refine], but with extra reductions on the resulting goals.

There was two used of this refine: one in the declarative mode, and one in type classes. The porting of the latter is likely to have introduced bugs.

Factored code with Ltac's refine in Extratactics.
Remove unused functions for side effects.
Proofview: factor init and dependent_init.
Proofview.mli: no more reference to Goal.goal.
Proofview: split [V82] module into [Unsafe] and [V82].

The Unsafe module is for unsafe tactics which cannot be done without anytime soon. Whereas V82 indicates a function which we want to get rid of and that shouldn't be used in a new function.
Proofview: move more functions to the Unsafe module.
Proofview: remove a redundant primitive.
Proofview: clean up commented out code.
Factor module signatures.
Small optimisation in the monadic list combinators.

The monadic bind can be costly, so sparing a few can be worth it. Therefore I unrolled the last element of the recursions. I took the opportunity to do some loop unrolling, which is probably more useful for map combinators than for fold.
Add a two-list monadic fold_left iterator.
Proofview: replace the functions iter_list and iter_list2 by generic monadic combinators.
Proofview: move [list_goto] to the [CList] module.

It is, after all, a generic function about lists.
Proofview: clean up code a little.
Improve readability the "lenses" in Proofview, using interfaces.
Add more primitives to the [Monad.Make] arguments.

For optimisation purposes.