Clean up php notices

As it is written, this library emits a bunch of php notices when php is
running at higher error reporting levels.  This update cleans up those
warnings.  It is very straight forward, except for determining trust of
`id`s (schema-store.php line 156).  I refactored the trust check to use
a regular expression.  I added several test cases to verify the refactor
didn't break anything.