Add scanDevices function that uses flags instead of bools.
Add and option to scan for loopback devices.