Fix issue 2086 and some other small problems.

Fixes of problems as noted by @timrae in PR #318:
* issue 2086: add tag if the add tag edittext has some text and the users taps the "select" button.
* "if you open the dialog from note editor, enter a tag into search box, close either via select or cancel, and reopen, the text in the search box is still there"
* "when you open via note editor, the list of tags is in alphabetical order with mixed upper and lower case, whereas when you open from the custom study dialog it's ordered with upper case first, then lower case."
Merge pull request #336 from brunodea/issue-2086

Fix issue 2086 and some other small problems.