Fix the user agent parser for Opera 15 and IE 11

For both Opera 15 and IE 11, it can't detects the right user agent
by the traditional means. Basically this change is same approach with
the parser of YUI core.
Fix the regex since IE 11's UA changed

Recently IE 11 seems to changed the UA string. So we also need to
fix it. See also yui/yui3#1045.
Work on 0.2.25pre.
Fix crash when encoding an undefined value.
Merge pull request #56 from okuryu/ua-fix

Fix the user agent parser for Opera 15 and IE 11