Re-write of cmerge.py

Re-wrote cmerge.py.
1. Improved flow and function layout
2. Added __main__ check
3. Simplified some functions
4. Re-designed how command line arguments work with argparse.