Refactor the mess in API test CMakelists.

- Fix the regression caused by WK2 tests calling WTF code directly.
- Remove the library used on Nix tests and move the code to a single
library used on all WebKit2 tests.
- Unify WebKit2 and Nix tests, they are both WK2 :-).
- Add a bit of flexibility to the CMakeLists otherwise would be impossible to
  do this patch.
- Apply the changes to EFL as well, so EFL port wont break when we upstream Nix.

Reviewed by: Rafael Brandão