Regexp rework

This PR is combined from fixes and improvements from my several branches.
Two main goals:
* support UTF-8 (already supported in PCRE, need only on XBMC wrapper)
* support for study and JIT compile of regular expressions

As you can see, there are some commits in this PR.
Can be split to two smaller PRs.