add licence + merge some small changes 

add missing licence and add minor changes. mostly formatting.

there is also a useful fix which adds a local node into a list of contact node so there is not ping exception if the cluster doesn't have any contact nodes yet
%% add local node
+    ContactNodes1 = ContactNodes ++ [node()],
+    ping_contact_nodes(ContactNodes1, Timeout).