Basic threading support via platform object, plus shared memory leak fix.