Imported existing libev workqueue code