learn: performance optimization for learn

Learn word will try to use the best possible query first and fall back
to the alternate one when required. This makes the worst case
performance to be execution of two queries. Before this commit, it was
unnecessarly making a word query
Using sync off and journal mode delete while bulk learn

This helps us to improve the learn speed
Implemented export all and import APIs

With this commit, varnam can export words and patterns into text files
and import it back. While importing there won't be any learnings
happening thus it will be faster
Exporting more words into the file

This will also improve the import speed
More test cases for import & export