Clean-up / re-factor

thread queue and task handler compiling and program functional