Add grid layout.
Fixup layout and add test-cases.