Feature/separate cli and extraction logic

Makes a clearer, less coupled design.