Refactored gmail client and beginning to write integration tests for it