Adds onAttach event.

Mmk, this is ready for review.

- Works properly for infinitely nested LayoutViews
- Also works on collectionViews
- Documented
- Backwards compatible

This adds `onAttach`. Ref #1856 for more about why this event is important.
Of course. I'll wait to do that until the rest of the PR has been reviewed and we decide that this implementation works for us.