Add commandline parsing and first part of main.