refactor, add tests, update readme.

Should now produce expected results on all tests.
Oh, the other reason (I think) I did this initially was just to have full parity with globule.match / grunt