More import cleanups

Next round of static analysis tool:
* fixing more implicit #includes
* removing obsolete #includes
* more forward declarations
* fixing broken examples/tests ;)

Small risk of breaking something.  If something breaks, then mostly of implicit #includes, which are not done any more.  Run the testsuite, but didn't test all the interfaces.  Waiting for Travis.