Expand refs constraints to include valid characters

Updates routes for branches/controllers/tags/logs_tree

Fixes #4831, #4865, #4932