readsensor.py: Updated to use sensor module
sensor.py: Code cleanup + fixed raise statements