Fix connection.queries logging.
Use db read to retrieve badge object.
Add --exclude-badges option.
Fix 'prevents this relation' bug (badge must be retrieved from write db).
Refactor command class.