Mostly implemented issue #4: Automatically find attached mobile devices.

+ Some code beautifications.