Refactor code layout to support building under windows
The historic growth of the project ended up in some circular dependencies which now cause problems on some platforms. Some of these dependencies are in the old ledger code which will be eliminated.
The code needs to be restructured to remove these circular dependencies and simplify linking of the project. The various platforms (Linux, Windows, MacOS) have to be supported.