Building the documentation of risklib and some refactoring

This is propedeutic to the course "how to build risk calculators with commonlib"