Fix some controller level logic

-- When deciding whether we should redirect to the friendly url, there was
   an assumption that the slug never contains a slash. For globally scoped
   slugs, this is no longer the case. Instead, they don't have leading
   or trailing slashes, but may contain internal slashes.
-- Add controller tests