Tidy up and split most OS-specific code to separate files.
Check bus:address and vid:pid validity.