Huge update.
Fixing some issues noticed in test cases.
Adding some test cases for UglyQueueManager
Adding some test cases for UglyQueueManager