Move poll logic out of js
Make poll finally usable!

In order for poll to be usable, we need mutable states and some sort of
concurrency.  While Haste provides these for you, I did not use them but
build my own for the reasons below.  Basically I use periodic timer
callbacks instead of (Haste's poor man's) threads.

The Haste.Concurrent does not mix well with IO monad (or did I use it
the wrong way?) and is thus making a lot of pain.  So I did not use MVar
of Haste.Concurrent, but wrote a simple mutable state API instead.

Also I was hit by a Haste optimizer bug (it disappear when set -O0) that
the optimizer generates js codes that evaluate to undefined.

The generated js codes are somewhat like this:
  var _1 = [0, _2], _2 = whatever;
And _1[1] is undefined.

It seems that the bug is triggered when the optimizer is unrolling a
tail recursive function.  So I rewrite the code to avoid tail recursion
by replacing setTimeout with setInterval; this works for now.