Refactoring: moved model types and operations into model.php.
Refactoring: renamed variable.
Script for dumping data to csv files. Added column filename for devices.