fix(compile): Collecting directives from tags that will be replaced

Fix the collecting of directives from elements that will get replaced
by another directive on an attribute. If the element has an attribute
or class directive that will replace the entire element, then do not
collect the directive on the element

Closes #2573

BREAKING CHANGE:
* Will break directives that made the assumption that any directive
on the replaced element would get collected
* Will break directives that expect to be collected twice when they
were replaced by another directive that is marked as replace