Refactor Bluetooth connection

Refactor the Bluetooth socket connection.
The code to establish a socket is not trivial. It should be easy to
reuse it for future projects (Albert, Arduino..)