fixed some of the file dependency issues.

Moved includes from .c to .h files.
Moved typedefs from .c to .h