Cleans up some header files.

- Added include guards.
- Moved include directives from headers to implementation files.
- Fixed a base64 infinite loop warning.