Optimizes LayoutTag to cache the grid information to speed up the page a little.
Fixes deprecation warnings in LayoutTag.