Added Unit Tests

For Unit tests to work properly I had to remove the "php_sapi_name() == 'cli'" check. Otherwise the `_match` function would return false all the time.