MODE-2259 Fixed the WF/EAP subsystem so that services are correctly deployed in domain mode.

This PR is only suitable for `master`. If the fix is correct, another PR will be required for the `3.x` codebase(s).
hmm...ok. This was taken from some example I found online of how to deploy webapps from a service. I'll look at moving it to `performRuntime`