     (when (get-buffer buf)
       (kill-buffer buf))))
 
-(defun get-text (var response)
+(defun vimgolf-get-text (var response)
   (format "%s" (assoc-default 'data (assq var response))))
 
-(defun read-json (challenge-id)
+(defun vimgolf-retrieve-challenge (challenge-id)
   (interactive)
   (with-current-buffer
       (url-retrieve-synchronously (vimgolf-challenge-url challenge-id))

(defvar vimgolf-start-buffer-name "*vimgolf-start*")
(defvar vimgolf-end-buffer-name "*vimgolf-end*")
(defvar vimgolf-keystrokes-buffer-name "*vimgolf-keystrokes*")

; Prevent the server from compressing the response
(setq url-mime-encoding-string "identity")

; Put url-http-end-of-headers in current scope
(defvar url-http-end-of-headers)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keystroke logging

    (json-read)))

(defun vimgolf-setup (status challenge-id)
  (let ((defvar url-http-end-of-headers)
        (url-mime-encoding-string "identitiy"))
    (setq response (vimgolf-retrieve-challenge challenge-id)))

  (vimgolf-clear-keystrokes)
  (setq vimgolf-prior-window-configuration (current-window-configuration)
        vimgolf-challenge challenge-id)
  (goto-char (point-min))

  (let* ((start-text (vimgolf-get-text 'in response))
         (end-text   (vimgolf-get-text 'out response)))
    (vimgolf-kill-existing-session)

    (let ((vimgolf-start-buffer (get-buffer-create vimgolf-start-buffer-name))
