split Sim.cs code across multiple files, and allow multiple Sim instances
comment most classes and methods, and reorganize some code