Removed dead code, small readability improvement.
Removed dead code.
Micro optimization.
Use native JS objects for identifying functions and arrays.

There's a bug in older versions of Firefox that always returns
`[xpconnect wrapped native prototype]` if the `toString` function is called from
the window context.

More information at https://bugzilla.mozilla.org/show_bug.cgi?id=684601