CB-4400: cd to project root in most cordova commands.

cd to project root dir as the first thing for most cordova commands by
calling a new func util.cdProjectRoot().

This function throws and exception if process.cwd() is not in a Cordova
project. In terms of interaction with the Q promises this exception
behaves the same way as those thrown e.g. by fs.readFileSync().

This change does not entirely solve the problem of running prepare while
in platforms/.../www/ dir (that is deleted during prepare). The
operation will now succeed, but the user's shell will stay in a bad
state with detached inode as the CWD.

The patch file has two separate commits in it (looks like it's not
visible here on the "View Diff" pane but will affect "git am"). One for
the main part and the second for tests.

Same diff on Github:
https://github.com/kamrik/cordova-cli/compare/CB-4400_chdir_root