Add test case for plugin installation endpoint.
Moved dependencies out of the install function.
Fix typo in plugin download links accessing.
Add return value for plugin installation.
Use a custom get request instead of plugins_api

It looks like `plugins_api` doesn't work with slugs like `the/the.php`,
only `the`. Let's use a custom request intead where those slugs work
just fine.