Refactor header files to remove the hxx files.

The hxx files are merged back into their hpp files. Some rearrangement of #include. This is known to build fine on Debian Sid. Untested on other platforms.