Remove some typedefs.h dependencies

- Replace several typedefs.h dependencies with either forward
  declarations or includes of the individual headers that are required.
- Some other cleanup in the selection code, removing stuff that is no
  longer necessary for C++.

Change-Id: I6b9b3fe5cbbcc8f6bac29c9306cc4c4c57e59479