Move unit tests to the plugin

This is a first pass at adding the unit tests in the plugin. 

I used WP-CLI `scaffold plugin` as a base, and the tests are just copy paste from the patch. Note that there is 1 faliure (with the latest patch from the ticket applied)

It also adds the stuff required for Travis CI.