Add multithraeded queue, todo: nicer exit