added tinytest & rewrote into a more precise and robust logic
travis ci integration