Fix imports and never do "using namespace" in a header.

There were many unused imports, or imports in a header for stuff in the
cpp file, and several using namespace things inside headers.