Update connection to use cordova events

Reviewed by Jeffrey Heifetz <jheifetz@blackberry.com>
Tested by Tracy Li <tli@blackberry.com>