Refactoring with unit tests. 0.1.2 will restore 0.1.1 functionality once refactoring is complete.