Migrate endpoints during upgrade.

broker code for endpoint upgrade of gears

Fix unit tests.
Merge pull request #4209 from mrunalp/dev/upgrade_endpoints

Merged by openshift-bot