improved regexs management

As suggested by perex, moved patterns and regexs as global variables and their management in opentv_init/opentv_done.