fix($compile): remove comment nodes from templates before asserting single root node

The compiler will no longer throw if a directive template contains comment
nodes in addition to a single root node.

The comment nodes will be removed before processing.

Closes #9212
I don't suppose that splice will update the `jqNodes.length` property for you, so you need to updated it manually. otherwise the jq collection will be messed up. please check the behavior of splice