Allow to run through command line

Pass the full file path to the program, and it extracts the directory path and the file name, and uses open(filename, 'r').read for input. Also added some informative prints in case of bugs.