Rework pretty much everything

Completely rework sensor handling.