Converting some Blink tests over & tightening upgrade logic

This is a rebase+squash of https://github.com/Polymer/CustomElements/pull/59

This pull request would be a huge help in unforking dart-lang/CustomElements. I think these patches are pretty clean, and just make the CE polyfill more compatible with Blink's native implementation, which seems like goodness all around :).

@sorvell -- would you mind taking a look?


Description from @blois original pull request:
> I'm working on using the Polymer polyfills for Dart when compiled to JS and we're using a number of tests from Blink. These tests picked up a number of differences which appear straightforward enough to be covered by the polyfill.

> Not quite sure what level of adherence to the spec the goal is for the polyfill, many of the issues were around negative testing.

> These changes are primarily to get the polyfill to pass:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-type-extensions.html

> Though I left off the createElementNS tests.