Improved error checking in extension.

Also moved the submodule to tests/data.
Improved error checking in pure PHP reader
Fix merge issues