Refactor scanning state, fix preferences key for ranging, remove ScannindDisabled service state, handle custom beacon layout preference, detect BT state changes