Refactor some of lib/ into science/
Refactor analyses to be run from the command line