[#2] Added common test suite.
[#2] Added tests. Improved code by removing unnecessary function clauses and adding docstrings.