Wait for iframe to load before updating preview

Instead of waiting time period, which is non-deterministic on certain browsers.

Fixes #40