Refactor and fix edge cases in switch_split_user_domain

We were incorrectly parsing usernames and domains starting with "sip"
if there was no sip: or sips: scheme in the string.

We were also incorrectly parsing usernames containing a colon even if
a scheme was given.

This also refactors the function for hopefully greater clarity.