added functionality so that library attempts to reconnect to spacebrew if the connection is lost. Also added a close method, to enable clients to close connection to spacebrew server.