Simplified the code by reusing the HttpKernel code rather than copy-paste

@patrickdreyer please test it as I don't have a Yii project to test it.

Btw, I find it really weird to have code using the WUnit top-level namespace. You should probably move all this to ``Behat\Mink\Driver`WUnit\*`` to be consistent with other drivers