Added import for marginals.
Pytest config, add doctests.
More complete tests.
Complete test coverage.