Created node_list_tuples in node.py, as a potential replacement for node_list.
The node_list_tuples does away with using the tuples that cursor.fetchall()
returns, avoiding the creation of dictionaries.
Additionally, node_list_tuples cuts down on SQL by not doing unncessary
operations on the SQL side such as computing the z_diff or setting the
'type' variable, or ordering results unnecessarily.
On the client side, lots of if/else with string comparisons are gone,
and there are still some further optimizations to do.
Currently both node_list_tuples and node_list exist side by side, both
in the server side and in the client.
Avoid pointless variable in now obsolete node_list function.
Remove period from error message string.
Use tuple rather than array for immutable lists.
Added documentation to node_list_tuples function.
Fixed documentation for refresNodesFromTuples.
Fixed documentation in newNode function.
Explicit arguments for createInterpolatedNode for clarity
and to prevent potential issues with the active node being changed.
The active node should not be changed if the old active node changed.
Added index to treenode table for skeleton id
Fix error in handling a REPLACED request in the nodes/list
Merge branch 'new-django' of github.com:acardona/CATMAID into new-django
'B' and 'V' no longer depend on having the whole selected skeleton loaded.
Add data views to manage different CATMAID front pages

Up to now CATMAID's front page is rendered in the browser using
JavaScript and JSON data about the projects and stacks. This works
well, but extending this to e.g. show images, had to involve
changing the JSON data structure and complicating the JavaScript
rendering.

This commit provides an alternative for defining CATMAID's front
page. A front page configuration is called "data view". This term is
used, because it can easily provide everything linked to projects
and stacks and is not limited to it. Defined data views are
available from a drop down menu of the "Home" link in the upper menu
of CATMAID. Data views can be created and altered from Django's
admin view or directly in the data base. One can define as many of
them as one wants. Especially for many projects this allows for
different views on the whole data set.

Two new data base tables (and Django models), data_view_type and
data_view, are created. The first defines the possible types of data
views available, the Django template to use and some configuration
hints. The second one is for the concrete views, parameterizing a data
view type. Currently, there is a "legacy project list view" and a
"project list view" type. Using the former, CATMAID will use the
current JavaScript based display. The latter will use a Django template
to render the data view and send the result to the user. It also
supports the display of images, based on several configuration options.

The configuration of data views is done using a JSON string, saved with
each data view. To make this easier, the data view type's configuration
comment is displayed in the Django admin view when creating new or
modifying available data views. Available options should be explained in
this comment. For the project list view type, this looks like the
following:

    A simple adjustable list of all projects and their stacks. This view
    is rendered server side and supports the display of sample images.
    The following options are available: sample_images: [true|false],
    sample_stack: ["first"|"last"], sample_slice: [slice number|"first"|
    "center"|"last"]. By default projects are sorted. Use sort:false to
	turn this off. Thus, a valid sample configuration could look like:
    {"sample_images":true,"sample_stack":"last","sample_slice":"center"}

By default, the project list is sorted naturally, this can be disabled
or made explicit by using: "sort":[true|false]. Saving a data view, will
check if the configuration is valid JSON.

Adding new data views needs only two changes: the template file to
render the view and an entry in the data_view_type table to make it
known to CATMAID.
Add a tabular data view to display projects and stacks in the same row

This data view also supports the display of images instead of the
stack stack names.