Turn on logging
More work on api, command line and refactoring