[globalrefine][fix] Respect refcount
As refcount was ignored in particular refCount = 0 still lead to refining once. This implements refCount as a loop. Certainly not the most efficient but at least this works.
Related to but doesn't fix #7 (closed).
Edited by Timo Koch