Creates a JSON search API using custom feed_* hook

What we want to achieve :

With those modifications we want to create a plugin doing a search API (ie. allowing ajax search requests), outputting JSON. The feed_* hook seems appropriate to do it but we were missing the exported variables.

Those modifications include :

* Make the regular 'doView' search and feed use the same code. Doing this, we have access in custom feeds to exported variables (like pagination)
* Add a hook "after_search" to be able to modify search results before doView or custom feed output. For example, we have a user_attributes plugin (age, gender, work activity) and for now we export those custom user attributes (for each item owner) in the search before_html hook. With that after_search hook, we can do it there and not in the before_html anymore and make those available in our custom JSON feed.

I'm open to suggestions if you got better ideas but it's a working solution ;-).
Merge commit 'pr/1574' into 1574

Conflicts:
	oc-includes/osclass/controller/search.php
Merge pull request #1577 from conejoninja/1574

1574