Cleaner match() implementation

Here's a cleaner, simpler implementation of the `match()` function. I also exposed the `parse()` function, so this module now has two `exports` instead of one default export.

I will add some comments about the unit tests in your PR on my fork. I figure you can merge this in here and we can keep working on this through your PR.