Strict mode.
Various updates.

  * Add support for device prefs.

  * Factor out error code checks into a check() function.

  * Minor cleanups, and untabify!  Augh.