factored out repepitive code that was common to both Simulator and Modeler into a 'Device' base class that provides API for communication with server to its subclasses