code cleanup, concurrency fixes, a major restructuring of the taint wrapper