Cpp rewrite finished. More or less.

Cout instead of printf.
New feature: mean momentum for source in config.