Add common measure function.
Fix compile errors.
Support setting layout type on a Node.
Implement 'layout' property for Views.