Move addScript into utils js. Implement public ip resolving.