Adding validator feature and adjusting width of input field to the size of the characters it holds

Adding validator property in settings. Validator needs to be a function which returns true or false and if its false we skip the tag and apply the not_valid class.

Also making the width of the input field fit the size of the characters in it when user hits enter.