Attempt at fixing compilation issue #3369. Moved struct hash declaration from docid.h to basictypes.h.
Included <functional> instead of hacking around it with a manual std::hash declaration