Added console redirection to ble-discovery and ble-scan. Re-organised ble-discovery JS code.