Validate password and username length.

Resolves #290, Closes #291.