Breaking out scale detection so it doesn't clutter listeners in app.js

Also broke out USB detection so it can be used as an abstract library.