DevTools: Make the "common" module window- and DOM-agnostic

This is required for the "common" module to be loadable in workers.

R=dgozman@chromium.org, pfeldman@chromium.org, aandrey, dgozman, vsevik
BUG=391566

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

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