Better handling of command line tag options

Refactor tag conversion into its own method.
Add a bunch of tests for that method.
FIXME optimise the output of `_process_tags`