Refactored. Added tests.
Release v1.0.1.