Rework so that it is very easy to run extraction from the command-line. Also remove the use of dets.