Eliminate index.d hack, and fix doc/unittest scripts.