Added automatic detection of dev environment for debug
Modified query prefix for admin
Modified getPublicCount to take into account ack status
Removed unused global variables