Reworked the GUI and added auto-launch

Reworked the GUI of the app to be more useful and controllable by the user.
Changed the app to auto-launch on app install and browser startup.
Restructure the code as a state machine

Change the code to handle the device connection in a state machine fashion,
making the structure and flow a bit easier to follow. Clean up the code a bit
and add some comments.
Merge remote-tracking branch 'upstream/master'
Merge pull request #62 from abbeman/master

Rewrote the app to implement the features we discussed over mail