adding additional tests, adding fix for race condition

This commit adds a cleared state so that the interval function wont
set a new timeout even though the current one has been cleared.
0.1.1