Switched from setTimeout(fn, 1) to setInterval(fn,0)

Switched mnist and cifar10 demos to using setInterval as mentioned in #1