Add util.c and util.h
Cleanup loop.c
Merge pull request #9 from Cloudef/master

Cleanup loop.c