Fix output from decode_connections

Strip off "|$app_uuid|$gear_uuid" from the end of all types of
connections (including TOHTTPS etc), not just from connections without
modifiers.
Bug 1067031 - Do not include old versions of carts in latest carts just because they have a unique software version
Merge pull request #4804 from danmcp/dev/bug1067031

Merged by openshift-bot
Merge pull request #4798 from ncdc/master

Merged by openshift-bot