Moves PubNub publish into own method. Publish button utilizes it.