initial tests structure
add first tests
Merge branch 'tests'
fix scoped variables
Satisfy tests

* Make sure loop function returns before first animationFrame tick
* Set cancel variable for faster canceling