Refactorings

- use a map to build up parameter lists
- double quote all input and output file paths to avoid issues with special
  characters like space and single-quote
- use log Fatal instead of panic
- use log instead of fmt.Fprintf
- fix up unit tests