Rewrite implementation of 2D mechanism.

There now is a link between the two "dimensions".
Add a simple example of 2D layout