Update PHPDocs, defines and var declarations

Update PHPDocs
Remove some duplicated defines
Remove unused variables
Update more PHPDocs, defines, etc
Improve handling of dolist arguments

* Accept id and md5 without failing
 * Accept capatilized status values.
Empty string namespace value triggers false seperator replacement