Start work on device.js.

Also fixed async validator tests.