Separate out main to make testing easier

Separate logging setup and ensure main can take a list of arguments so
that tests may provide a command line.

Additionally ensure that the import subcommand provides a return status

Change-Id: I1917913a4051b0da51bdfec01dcbde33e7db3116