Prefer apikey/secret from commandline; Trim whitespace; Logging

This time tidied.