Problem with input field, maxlength attribute and long placeholder text

The current code causes a problem when the input field has a maxlength attribute and the placeholder text is longer than that length. The current pull request solves this by clearing (and storing) the maxlength value when the placeholder is shown and restoring it when the placeholder should be hidden.

While achieving this, I also removed code duplication in `makeKeyupHandler`.