Optimize Layout#getViews

Some performance optimizations that also make the code smaller and easier to read. Triple threat!