Draft: Remove 1.414 snr threshold and replace it with statistical thresholds
I've combined some fixes for the issues above into a single branch. This MR is mostly to share the changes for testing and further development. Don't review the changes until we've had a discussion/test of the science results (and memory usage).
Note I've merged !151 (merged).
Edited by Timothy Davies