remove a lot of duplicate code from AHJ.js

but there's still more there to remove
preprocess the q&a data, in order to simplify the template

The database gives us a flat list of questions and answers, we build
nested set of dicts to organize them; this eliminates the need for the
template to contain a state machine, making it readable and logical.

This change breaks the 'hide unanswered questions' option, since that
has the side effect of not including any questions in the list,
breaking the code that builds the data structure.

The existing code already did a number of preprocessing steps to
gather other data; these ought to be folded in and the data added to
the data structure instead of to parrallel arrays. Once this is done
the preprocessing step can be moved to get_ahj_data and a fair amount
of duplicate code removed.
no need for a separate sorting step
remove parrallel data structure questions_login_user_suggested_a_value
remove parrallel data structure questions_have_answers
remove parrallel data structure questions_teriminology
remove parrallel data structure questions_pending_editable_answer_ids_array
remove parrallel data structure answers_content
fix dajax when minified
pass the correct variables to included templates

These all look like they're included from other places, so until we
can refactor those as well we'll just have to define the variables
that they want to access. Fortunately, we can do this without adding
global variables by using 'with' blocks.