Refactor pre/post-prepare hooks as in-process events based hooks

 - Hooks are now registered as events.on() and will run in the same process
 - Hooks access context data via the Context object passed in as argument
 - File based hooks replaced with a check that will fail if run with `cordova` and not `cca`
 - Use cordova-lib from cordova-cli and remove cordova-lib from direct dependencies
 - Requires a cordova-lib fix apache/cordova-lib@a2165e2f211be2ab3642b2e83b37c82862588a24
 - Add underscore for some convenience functions in pre-prepare

CCA had two copies of cordova-lib. One as direct dependency in
node-modules/cordova-lib
and the other as cordova-cli's dep in
node_modules/cordova/node_modules/corodva-lib.
The two copies might end up being of different versions, but even if they are
identical it still results in two separate instances of the EventEmitter and
breaks event registration and handling in some cases.