Refactored and wrote tests for all the code dealing with mailing lists.