Rewrite auto completion functionality. Merge into a single branch for ST2 and ST3