Add hard coded parenthesis to advanced search query.

'OR's begin and end parenthesis:
(a AND b NOT c) OR (d AND e) OR (f)
Refactoring code.
Merge branch 'haun_parannus_vaihe2' into development