GridLayout fixes

This CL fixes a bunch of bugs in GridLayout.

I also added some basic tests to verify that these things don't
break in the future.

Parent bug:

Bug: 19546781

Sub bugs:

Bug: 19571249
Bug: 19571653
Bug: 19571319
Bug: 19571841

Change-Id: Ia087687b03cfb389431674fd7d654b8fbf4a52b2
12 files changed