Refactor Username credential

Added equality method and converted asserts to public static guard methods.