Docblock and syntax updates

Went through and checked that all current functions and classes conform to
Zend standards by including detailed docblocks for each.

Changed all syntax to conform to Zend standards (i.e. string literals use
single quotes, braces for functions and classes start on next line, etc.).

See
http://framework.zend.com/manual/1.12/en/coding-standard.coding-style.html
and http://manual.phpdoc.org/.