Sorting out discrepancy between HTML maxlength and JS character count

Fixes #53