Add threading to content collection

(No 4-level limit at the moment). Also many fixes.