Improve core and add tests from the php project

Add match method, filter the headers, and make user agent writable
add tests, which seems to break data loading
Fix data loading, was order issue, organize the tests, require pry as a dev dependency