added tests and addressed #109

This PR 

- adds test for modules in the `lingpy.algorithm` package,
- addresses #109 within these modules,
- refactors dicts with lists as values using `defaultdict(list)`,
- removes dead code.