Loop plugin

New PR which joins settimeout (for ev) and the wish to modularize the loop implementations