Optimiser more or less working. Still lacks thread control (stop/interrupt threads and recovery).