Fixes from PR. Push layoutData declaration down to where it's used. Stop leaking global ViewAdapter, parsed variables.