add utils.wait_for_idle in js tests

and use it in execute_cell_then, since there is not always output.

Should fix some failing js tests

*fingers crossed for Travis*

Ping @jdfreder, since I asked him to look into some of the intermittent js failures, and this might be a starting point.