Major restucturing of main program:

- put main body into "if __name' == '__main__'" block
- split up main body, so ready to call functions located in other files
- put command line args in seperate function to keep flow
- put module/program checkers into separate functions