Modify A::D::Query to use POE events rather than while(1)

**Which issues (if any) does this change solve? (please link them here)**
n/a

**Briefly describe your fix. Are there any important details we should know about?**

* Uses POE's events correctly to generate the "infinite loop" effect
* Some other small changes for efficiency

**Are you having any problems? Do you need our help with anything?**
n/a
Not that it was any good before, but the indentation is still a little wonky here, please fix -- All this code uses tabs, eventually I think it will be moved to spaces though