Refactored AQ to the state where it actually works.
Added batch queue processing.