Normalize usernames to lowercase on lookup, creation, and update. Also fix variable shadowing bug and same-user update check in the user update endpoint.