Implement grid layout.

Activate via the `grid` boolean attribute.  Requires specifying item width in addition to item height.

This PR also fixes a couple of minor bugs and implements basic resize support (window resize only, no element size tracking).  I can split these out if you'd prefer not to take them as part of this request.