anchor.diff:                                (array-cdr res))
               (array-cdr res))))
   
  -    (defun filter-opins-score (tree-addresses opinions warstats)
  -      (let ((res
  -             (collecting
  -                 (dolist (ta tree-addresses)
  -                   (let ((id (list-last ta)))
  -                     (when (< 2 (getprop warstats id 'effect))
  -                       (collect id)))))))
  -        (chain res
  -               (sort (lambda (a b) (- (getprop warstats a 'effect)
  -                                      (getprop warstats b 'effect)))))
  -        res))
  -
  -    (defun filter-opins-controversial (tree-addresses opinions warstats)
  -      (let ((res
  -             (collecting
  -                 (dolist (ta tree-addresses)
  -                   (let ((id (list-last ta)))
  -                     (when (< 2 (getprop warstats id 'controversy))
  -                       (collect id)))))))
  -        (chain res
  -               (sort (lambda (a b) (- (getprop warstats a 'controversy)
  -                                      (getprop warstats b 'controversy)))))
  -        res))
  -
  -    (defun filter-opins-question (tree-addresses opinions warstats)
  -      (let ((res
  -             (collecting
  -                 (dolist (ta tree-addresses)
  -                   (let* ((id (list-last ta))
  -                          (opin (getprop opinions id))
  -                          (stats (getprop warstats id)))
  -                     (when
  -                         ;;FIXME: This is a crude definition of a question. Reconsider
  -                         ;; if/when we implement "Accepted" flag. Also if directives
  -                         ;; are added.
  -                         (or (chain (list "needsEvidence" "raiseQuestion")
  -                                    (includes (@ opin flag 1)))
  -                             ;; Wrong axis is a stand in for being answered. For now.
  -                             (< 1 (@ stats x-wrong 0)))
  -                       (collect id)))))))
  -        (chain res
  -               (sort
  -                ;; Have arbitrarily decided to sort by combined controversy and effect
  -                (lambda (a b) (- (+ (getprop warstats a 'controversy)
  -                                    (getprop warstats a 'effect))
  -                                 (+ (getprop warstats b 'controversy)
  -                                    (getprop warstats b 'effect))))))
  -        res))
  -
  -    ;;
  -    ;;Utilies taken from opinion-form
  -    ;;
  -
  -    ;;FIXME: Duplicate of lisp functions in excerpt.lisp
  -    ;;Would be nice to only implement once.
  +    ;;FIXME: votevalue might not remain
  +    (defun opinion-p (itm)
  +      (and (not (atom itm))
  +           (chain itm (has-own-property "votevalue"))))
  +
  +    (defun focus-p (props?)
  +      (if (and (@ props? focus) (not-empty (@ props? focus)))
  +          (eql (list-last (@ props? tree-address) (list-last (@ props? focus))))
  +          t))
  +
  +    (defun focus-parent-p (props?)
  +      (let ((fparent (getprop (chain (@ props? focus) (slice -2)) 0)))
  +        (when (eql (list-last (@ props? tree-address) fparent))
  +          (getprop (@ props? opinion-store) fparent)))
  +      (when
  +          (eql (list-last (@ props? tree-address)) fparent)))
  +
  +    (defun immediate-children-ids (id opinstore)
  +      (if id
  +          (let ((len (@ (getprop opinstore id) 'tree-address length)))
  +            (collecting
  +              (dolist (itm (all-descendant-ids id opinstore))
  +                (when (eq (1+ len) (@ (getprop opinstore itm) 'tree-address length))
  +                  (collect itm)))))
  +          (collecting
  +            (do-keyvalue (k opin opinstore)
  +              (when (eq 1 (@ opin 'tree-address length))
  +                (collect (@ opin id)))))))
  +
  +    (defun all-descendant-ids (id opinstore)
  +      (if id
  +          (let* ((trad (@ (getprop opinstore id) 'tree-address))
  +                 (len (@ trad length)))
  +            (collecting
  +              (do-keyvalue (k opin opinstore)
  +                (when (< len (@ opin 'tree-address length))
  +                  (when (array-equal trad (chain (@ opin 'tree-address) (slice 0 len)))
  +                    (collect (@ opin id)))))))
  +          (chain -object (keys opinstore))))
  +
  +    ;;; Excerpt and text tools
  +
  +    ;; Also in lisp
       (defun create-textdata (text)
         (let ((res (create :text text :whitespace (create)))
               (found nil))
  
positive.code:             (setf found nil)))
          res))
  
      (defun contiguous-whitespace? (tdat index)
        (or (getprop tdat 'whitespace index) 0))
  
      (defun excerpt-here? (tdat excerpt index)
        (let ((exdat (create-textdata excerpt))
              (text (@ tdat text)))
  
negative.code: 
  (define-ps-lib wf-web-library ()
    (ps
  
      ;;;Paths and urls
  
      ;; Also in lisp
      (defun make-id-path (id)
        (if (< id 1000)
            "/0000/"
  