Clone template contents in importNode

The template element has no children but contains content, the old importNode behavior only does classical child traversal so special case template elements to import its contents in addition to the normal traversal, like HTMLTemplateElement cloneNode implementation does. Refactor the children traversal importNode into a helper method for better readability and reuse.

BUG=341672

Review URL: https://codereview.chromium.org/173303004

git-svn-id: svn://svn.chromium.org/blink/trunk@167698 bbb929c8-8fbe-4397-9dbb-9b2b20218538