Use w instead of window so we can shim it at will

Directly referencing the window object always binds us to the current
window.  By using a local variable, we can tie it to any window object,
possibly also a fake one implemented by node for testing.
Move spdy check to navtiming.js, add firstpaint

Since spdy is part of window.chrome.loadTimes(), which is related
closely to navtiming, it's better to move this check into the navtiming
plugin.

Additionally, add the firstPaintTime, which is also part of loadTimes()
we do not use d in the bw plugin
Do not run ipv6 test over SSL

The IPv6 test requires connecting directly to an IP address.  Since this
will always fail an SSL certificate check, there's no way we can run
this under SSL without throwing an error.  Skip instead.
Use the correct alias

p works even in older browsers.  w.performance only works in newer
browsers, so use p instead.
Check if running in iframe-async mode and adapt

To avoid blocking onload, we'd like boomerang to run in an iframe-async
mode.  This is described in detail by Stoyan here:
  http://www.phpied.com/non-onload-blocking-async-js/

Also check the references on that article.

We have a few complications because we need access to the parent window
object, need to make our API available to callers in the parent window,
and as far as possible need to load before the document's onload event
fires.  This requires us to define the BOOMR object on the parent as
well as the current window.
Hold reference to actual window object

BOOMR.window now holds a reference to the actual window object.  Other
plugins can reference this object when they need access to the window.
Reference BOOMR.window instead of w where possible

In most cases where we use the window object, we use it inside a method
that's called through or after init().  Since init() is always called
from boomerang.js, we know for certain that BOOMR.window has been
defined at this point, so we can use BOOMR.window instead of w in all
these cases.
Adapt if w is not the right window

w and d are used in several locations across the rt.js plugin, and they
are defined in global space.  This makes it hard to change the reference
in one place.  The only place we can change it is in the init() call,
since this is always the first method called.

We check if the passed in w object matches the predefined BOOMR.window
object, and if not, redefine it so we have the right reference.
Report first_paint in milliseconds

firstPaintTime is reported in seconds.microseconds.  All other times are
reported in milliseconds with optional microsecond precision.

This patch changes first_paint from seconds.microseconds to
milliseconds.microseconds with no loss of precision.
Revert "Report first_paint in milliseconds"

It turns out that this patch reports 0 as the first_paint time on page
reloads.  Better to report in seconds.microseconds and convert
server-side.

This reverts commit aabcbe1360a2f779d23dad31c75dbe7d1c720001.
add docs for nt_spdy and nt_first_paint
clear BOOMR.window on unload to avoid memory leaks from cyclic references
document iframe usage
Add `if' parameter if running in iframe

It's useful from a statistics point of view to know how many beacons
came in from boomerang in an iframe v/s boomerang in the main page, so
add that to the beacon.
Prevent empty first argument

The var loop prepends an & to every k-v pair, and appending this to a
url that already ends with a ? or a & results in a url that looks like
this:

http://foo.com/?&v=...

or

http://foo.com/?something=blah&&v=...

ie, we get a ?& or a && in the URL, which results in an empty parameter.

This patch rewrites the url generating code to use an array and then
array.join to make sure the query string part does not have an & prefix.
use subscript notation for reserved word

if is a reserved word, and yuicompressor doesn't like it used as an
object property using dot notation, so switch to subscript notation.