CLI: make autocomplete faster

Add an 'active pattern' cache that keeps the patterns that yielded results
in the last call to complete(). The cache reset to hold all possible patterns
when a command is run or complete() is called with an input that doesn't start
with the previous input.

Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>
CLI: autocomplete enum attr values

Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>
Merge pull request #49 from gontanon/autocompleteBug

CLI: autocomplete fixes