Move proof logic into cas core
Diff is workingish. Up to 70% covered