Fixes #1417 & Fixes #1376 Login Issues

Fixes #1417 Apostrophe in User Name
Fixes #1376 Allowed Login Methods
Fixes #1390 get_user_by_username double flips an array