mod: merge PersistentQueue and Queue code