get correct request uri

The ```q``` could be changed in the settings so get the value from the settings. Also you should use $_REQUEST instead of $_GET, since $_REQUEST contains the correct URI without the base_url of the context (as its saved in the uri field of a resource).

This fixes issue #18.