Move PID generation out to a separate function, so it can be overridden.
Add missing parameter.
Use "static" to use late-static bindings...

... Islandora required PHP 5.3, so we should be fine.
Pass additional parameters, to allow for information to be aggregated.
Make sure report gets registered as a file with Drupal.

... Want it to clean them up eventually. Registering the report as a
temporary file should allow it to automatically get deleted after 6 hours
or so.
Remove weird default.
Code standards.

Included restoring the original datastream ID detection, which uses
the functions from Islandora to perform the heavy-lifting in reading
the DS-COMPOSITE-MODELs, instead of the custom code that was included.
Fix filter_xss() function call.
Fix initialization of static variable, and make error reporting consistent.
Fix indentation error.
Squash extra new-line.
Merge pull request #15 from adam-vessey/7.x-alter-pid-acquisition

Miscellaneous fixes and improvements...