Support multiple localrcs in devstack-gate.

There is a lot of per-branch logic involved in building a localrc
(especially the ENABLED_SERVICES).  Move that into a function that
can be run for both old and new localrcs for grenade.

Fixes bug 1162214

Change-Id: Ia9f366418739696aeb4f31cce00f2fa372e90028