CLI now uses flags.

Also fixes #38