Code cleanup and PHPDoc comments Fixes #36