Added and exported method `test`

Here is some code that works the way I envisioned in https://github.com/jxson/front-matter/issues/14.  I introduced a DRY violation that should probably be addressed before merging into master and there might be a nicer way to write the test other than the `if {} else {}` format.