Allow mesh refinement plugins to act on global refinement

Instead of calling global_refine(n) we now flag all cells for refinement
and then allow the mesh refinement plugins to unflag the cells if
desired. This procedure needs to be repeated n times. If there is no
plugin that modifies the flags, it is equivalent to refine_global().