fix($compile): reorder the capture of the directives with templateUrl

When a directive defines a templateUrl, directives on the top level
element will be applied after the directives on the original node
even if the directive defines `replace: true` and `transclude: true`

BREAKING CHANGE:
* The compilation and linking order of directives that are defined
on the top level element of an external template are compiled and
linked after the directives of the original node