Adds onAttach triggerMethod.

Adds `triggerAttach` and `beforeTriggerAttach` triggerMethods.

This is the 3rd out of 3 PRs to get #1886 in.
Instead of using a boolean flag in `_triggerAttach`, it could pass the prefix string directly:
```javascript
this._triggerAttach(displayedViews, 'before:');
```
```javascript
this._triggerAttach(displayedViews, '');
```
This would make the `_triggerAttach` role more clear, even without looking at it.