fixed indices, problem specific calls

Various changes.  Fixed a problem with indexing, also made it so that
each individual problem has its own threshold files.  Added some
optional debugging output.