Slight refactor. Read below pls.
Slight refactor. Read below pls.

Don't set $el on this ('this' being the modal pattern instance), since there is
only one global pattern instance and not a one-to-one mapping between pattern
and $el.

See: https://github.com/Patternslib/Patterns/issues/345

We have to overcome the original problem of not having access to $el from
within setPosition. I've done that now by only registering the event handlers
once the modal is actually being rendered and binding $el to the event handler.

This is nicer in any case because it reduces the number of handler calls.

Tests still pass and tested with various tricky modals in Star.

Patternslib/Patterns-archive,Patternslib/Patterns-archive,Patternslib/Patterns-archive