Strip whitespace before submitting registration fields.

Resolves #292, Closes #299.