Fix normailize ids

I added several test cases some I can refactor normalizing ids
(schema-store.php line 156) to not emit php notices.  This helped expose
a bug in the `resolveUrl` function.

*resolveUrl bug*
On line 63, the URI path is exploded on `/`.  The path always starts
with `/`, so the first value in the array is always an empty string.  On
line 65, instead of taking the empty string off of the front of the
array, it was dropping a value from the end of the array.

*normalize ids refactor*
I wrote a regex to do the trust check.  I hope you don't mind regular
expressions.