refactored tests to use mocks

refactored the tests to use the 'mocks' library, which allows cleaning
up the main bot source code and avoiding having to pass in functions to
the scan_comment function