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.

Done.


On Sun, Jun 8, 2014 at 10:52 PM, Justin Uberti <notifications@github.com>
wrote:

> In samples/web/content/apprtc/js/main.js:
>
> > @@ -228,7 +241,7 @@ function calleeStart() {
> >  function doAnswer() {
> >    trace('Sending answer to peer.');
> >    pc.createAnswer(setLocalAndSendMessage,
> > -                  onCreateSessionDescriptionError, sdpConstraints);
> > +    onCreateSessionDescriptionError, sdpConstraints);
>
> and here
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleChrome/webrtc/pull/71/files#r13526450>.
>