There's a description on my Torq support website detailing what you need and how to remove these components Steve. The only difference is that you need the similar freewheel removal tool and not the cassette removal tool mentioned there:
Removing a freewheel/cassette
If your motor cable comes out of the spindle on that side, it will have to be parted to thread on the removal tool, and in some cases where any connector is too large for the removal tool to pass over it, that may have to be removed as well.
I've found in some cases that it's possible to bend a tight curve in a spoke so that it can be threaded past the sprocket into the hub hole, even with megarange sprockets, so that's worth a try, and you can pierce a small hole through that plastic guard for the spoke to pass through. Straightening the spoke afterwards and tensioning it will leave it ok just so long as you haven't sharply kinked it.