test coverage

minimal changes to code. refactoring on `refactor` branch. tests require mojito, and I put a trimmed down version of 0.6.1 in tests/fixtures.

tests pass on travis, sd job soon.

    Statements   : 95.89% ( 373/389 )
    Branches     : 88.64% ( 156/176 )
    Functions    : 97.73% ( 43/44 )
    Lines        : 95.88% ( 372/388 )