Fixed bug in ls370 module, a type was missing.
Refactored simulation system.
added unittest for to_instance helper.