Override cloneNode to upgrade cloned elements before DOM insertion

- Also added a test for cloneNode