Add support for chrome-extension: protocol

Hello there,

I'm trying to use segment.io inside a chrome extension, and with the current implementation is not working as expected.

The problem resides in the fact that this library is loading a http resource, instead of a https (this because chrome-extension: !== https:). Chrome extensions demands you to load external files using the https: protocol. Hopefully this PR helps with this issue.

Fortunately you were smart enough to put this code on a library, and this will make all the other clients work correctly, great work!.

Cheers.

P.S: Also I fixed a broken test, the type library is returning "element" instead of "object", just updated that to make it pass.