An Index Theory for Singular Solutions of the Newtonian $n$-body Problem