Fix endpoint manifest entries in database cartridges

Make the private IP/Port names consistent with the public endpoint
naming expectations and with the expectations of the configure scripts.
Merge pull request #1377 from ironcladlou/bugs/db_endpoint_manifests

Merged by openshift-bot
use correct sort syntax
Performance fixes around retrieving apps and domains
Merge pull request #1375 from danmcp/master

Merged by openshift-bot