Added some assertion checks in soundness checker.
Refactoring soundness check interface.
Refactoring abstract proof interface/algorithms.
Less boilerplate, refactored generic types and modules.
More tidying up.
Checkpoint in refactoring the generic core.