Converted the SQL params within badges_get_user_badges to named params. Unit tests added for this function at the same time. UI covered by behat already.