Add maxlength directive. Closes issue #5