VE-1497: Created MediaWiki API method that delivers list of templates based on passed query

This method is meant to be used within newly developed template tool in VisualEditor.
Its behavior is specifically described in JIRA ticket.

https://wikia-inc.atlassian.net/browse/VE-1433
https://wikia-inc.atlassian.net/browse/VE-1497