Add and pass tests for writing to contacts.txt from flush method.