Extract leaf code into namespace
Switch RAF rendering to simple setTimeout