Add commandline parsing and first part of main.
Fix some build errors.
Merge pull request #9 from nickvirag/handle-commandline-arguments

Handle commandline arguments