[WFLY-2879] - Remove duplicated code from test cases where custom module...

...s are needed.

This was originally https://github.com/wildfly/wildfly/pull/6577 but it appears that got closed rather than merged. I noticed this when doing https://github.com/jbossas/jboss-eap/pull/1629 which then showed that this work was not part of upstream.

The TempTestModule class needs to be removed once wildfly/wildfly-core#151 has been released, and updated to use TestModule from wildfly-core. https://issues.jboss.org/browse/WFLY-3807 is there to make sure this does not get forgotten.