[CB-4490 & CB-4036] - added check for cordova-plugman and made a util function