Moves some classes from top-level to 'internal' sub-package.
Refactors lifting of logic relations on random variables.