Use jquery trim() instead of standard JS trim() from IE 8 compatibility.
Rename api_output -> api_result, which is DDG-preferred variable name.
Allow leading and trailing spaces and a trailing question mark. Added tests for this as well, which pass.
Updated API parsing to handle the 'duck.co' case, and also to make a little cleaner.