Implement password editor.
Fixed regression: the caret position lost.

caret position is lost in the case:
  - Edit TEXTAREA field, input some character
  - Edit PASSWORD field
  - Edit TEXTAREA field again, the caret lost.
Add testcases for PASSWORD editor.
Move libs/text_editor.js to midp/text_editor.js
Merge pull request #560 from PinZhang/pzhang/texteditor-password

Pzhang/texteditor password