New script threading model + tonnes of fixes