Extracted the Karma configuration into a separate file,
karma-common.config.js. This is used within the gulp file and the
karma.conf.js as a shared config. The singleRun property is overridden
in the 'test' task in gulp for a single run. This has removed the need
for the 'runKarma' function inside the gulp file and reduces the
complexity of the process.