Refactor to use Q.js promises in place of callbacks everywhere.

This significantly cleans up many parts of the code, and generally
shortens it by 25%, by dropping redundant error checks.

NOTE: This DOES NOT change the "public" API of CLI, in the sense
that cordova.foo still takes a callback. Under the hood, it wraps a call
to cordova.raw.foo. If you downstream CLI and require modules like
platform.js directly, (a) stop, and (b) you'll have to port to promises.

I created the cordova-3.1.x branch for all bugfixes for the 3.1.0
release, since this code should probably bake for a while before being
released to npm.

Mostly fixed tests.

Fixed all tests (expect the broken BB10 ones)

Cleaning up debugging output

First pass over async refactoring.

build spec passing

CLI and Compile specs passing.

Create tests repaired.

Fixed tests for emulate, hooker, and lazy_load.

Fixed platform tests.

Fixed plugin tests.

Prepare tests fixed.

Run tests passing.

Fixing some of the parser tests.

Platform parser tests all fixed.

And the final burst of tests fixed.

Fix a few error messages and other problems.

Refactor to preserve top-level semantics.

Add tests for the cordova.foo -> cordova.raw.foo wrappers
[CB-4604] Execute hooks directly (not .bat files) cross-platform
Remove two debugger; lines that snuck in.
reapplied change to add event mid build to allow mods to www folder pre_package  aka 775e969f9cc27a580123897d922121d564d4554d
[CB-4883]: Graceful handling of lazy loading errors.

Shows good error messages, and doesn't leave junk in the cache, on
failed lazy load downloads.
First pass
Fix busted test.
[CB-4877]: Add basic logging, --silent flag.
Fix cli.js tests broken by --silent change.