Cleaning imports of several shogun classes in base, lib and machine

Trying to cleanup the code base:
* no unused imports
* using forward declarations in header files
* moving imports from headers to implementation

The suggestions for this cleanup have been generated with clang plugin `iwyu` (done with static code analysis).