I've completely rewritten this script from scratch. Here are the changes:
Definitely aesthetic and UX improvements.
GTX0's funky username-checking captcha has been replaced with basic math. Also good UX here (it's only two characters long so people can't get confused and write "fourteen" or something).
Better error messages
Password confirmation input
If you register with a username that already exists as an altname, it automatically becomes your primary username.
If you register with a username that doesn't have an altname for it, it'll create one and assign it as your primary username.
You no longer need an admin to activate your account / activate it through email.
In fact, you're also automatically logged in and go back to whatever page you were on.
Just an aesthetic / UX upgrade here. Functionality is exactly the same.
I've installed a third-party mailer and gone through a bunch of verification steps to get gtx0 messages to bypass gmail's spam filter. I would like to require email verification of accounts at some point again, but it may take a while.