Machine classes and ToolWorkstation clean-up and fixes.

This should fix at least the ToolWorkstation breaking module dupe.
The code to handle the module writing/reading etc is still messy
and feels really error prone. Maybe that stuff should be moved
to the slots instead of trying to handle it in the TE and partially
Container atm.