Convert integration/api_test:TestGetEvents into a unit test and a CLI test

In this specific case replacing the existing test with a single unit test would mean loss of code coverage, so I created both a unit test for the api-specific bits and an integration-cli test for the 'events' command.