Finished writing tests for the TagsRepository. Refactored some of the code in the TagsRepository.