Reformat recording code to be more python based rather than command line based.