Change return type of method connectToAP to bool

Similar to the methods connectSecure and connectOpen, a boolean value indicating success or failure is returned by connectToAP.

Furthermore some additional checks have been added to methods getIPAddress, ping, and getHostByName; they require the device to be connected and the DHCP process to be completed.

Method begin can return immediately if the device is already initialised.