New version of patch is in the attachment. Some comments was added in this version. Likely these comments need significant correction because of my english.
Some notes abount gin interface functions. Extract query and extract value functions was separated, because with wildcard search these funtions no longer do the same. New arguments was added to sql description of gin interface functions in order to make it confom to new gin interface. See docs of development version: http://developer.postgresql.org/pgdocs/postgres/gin-extensibility.html.