Constrain username textbox maxlength

Make it so that username fields have maxlength of 30 (hardcoded) so that you can't provide a username longer than the system will accept on the login / profile pages.  Update generation to include the placeholder and maxlength only when they're necessary.

I'm not sure whether I think it's a worthwhile change but figured I'd PR it anyway, so feel free to just close if it's not DRY enough etc.