ecmascript: Add page.flush()

Fixes #2342
osx: Generate device id
ecmascript: Add showtime.deviceId

Fixes #2341