Some old pig scripts for inspiration
Added a whole bunch of unit-tests for device detection and improved device recognization for Apple devices.