More refactoring: use namespaces, replace header guards, etc.
Additional refactoring: use namespaces, change header guards, etc.