Cleanup of APLQuery

Added final notes and PHPDocs. Removed any unused/old code.