Move script functionality into module

Something something testable.
command_line: argument parsing function
Move code around
Tests scaffolding