Remove unused functions and add more test coverage

deque has faster appends than a list