Catch server 5xx errors using this assert
Do not flush, you never know when the script is reloaded.
Add startup script to set permissions (hopefully fixes #5) and cleanly flush once.
Clean up Apache logs prior to startup
More meaningful debug information.
Dequeue and then check for null, otherwise you could have a race
where the queue is non-empty when you check, but empty by the time
you dequeue.