Indexnode class syntax.
Const-correctness in indexnode.c

And some knock-on effects, as you might hope/fear.
More const-correctness around indexnodes and proto_indexnodes.
Fix initialisation and lifecycle of indexnode.
Put some indexnode functions under unit test.
Pedantic cleanup on exit to keep valgrind happy.