Fix Mac build.

- Virtual methods needs to go in the cpp files (Chromium style).
- Replace include of <hash_set> which is not working on clang with "base/containers/hash_tables.h" which is what we use in the code. Silent the bug of cpplint which claims I need to include <hash_set>.