jshint: js code validation and beautification

As discussed with Justin, this pull request includes the following changes: 

1. Ran JavaScript beautifier, as per jsbeautifier.org – this is not strictly anything to do with JSHint but makes it easier to spot invalid code. (We may want to tweak code layout further at some point – opinions vary...)

2. Added global 'use strict' to main.js and updated code to avoid errors.

3. Added JSHint options to main.js and updated code to validate.

@juberti and @marwahvikas PTAL.

Good call – agree we should follow the style guide. I just did a commit
with four spaces for
    wrapped lines.

May have missed some – can't find a way to automate this (in practice,
after initial formatting, not sure that's a problem).


On Sun, Jun 8, 2014 at 6:19 AM, Justin Uberti <notifications@github.com>
wrote:

> In samples/web/content/apprtc/js/main.js:
>
> >
> >    if (xmlhttp.status === 200) {
> >      var turnServer = JSON.parse(xmlhttp.responseText);
> >      // Create turnUris using the polyfill (adapter.js).
> >      var iceServers = createIceServers(turnServer.uris,
> > -                                      turnServer.username,
> > -                                      turnServer.password);
> > +      turnServer.username,
>
> and here
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleChrome/webrtc/pull/71/files#r13522729>.
>