Clean up and document the threadIdx replacement demo