Improve timeout logic

Limits the maxlength to prevent NumberFormatExceptions
Reference:
http://reports.openfire-technologies.net:5984/acralyzer/_design/acralyzer/index.html

Also allow setting 0 for default value
Use 100ms timout if timeout below 100ms

Patch Set 2:
Preference, set 1000 as value if
empty text is null or empty

Change-Id: Icb0f9a37cab1a9aa6935ca480887c650480b3a9b