Huge commit, switch to struct extended_symtab

This includes the switch to a more generic representation of the
extended symtab as a struct, rather than as a strange pointer list.
This led to a change of API, which led to substantial changes in
all of the tests. I also debugged some of the popcount and other
c_trie code.