Rewrite to take everything from empirical distributions

Still validating and cleaning up, but it seems to be working.